@@ -7864,11 +7864,11 @@ function isIOUOwnedByCurrentUser(report: OnyxEntry<Report>, allReportsDict?: Ony
78647864 * Assuming the passed in report is a default room, lets us know whether we can see it or not, based on permissions and
78657865 * the various subsets of users we've allowed to use default rooms.
78667866 */
7867- function canSeeDefaultRoom ( report : OnyxEntry < Report > , betas : OnyxEntry < Beta [ ] > ) : boolean {
7867+ function canSeeDefaultRoom ( report : OnyxEntry < Report > , betas : OnyxEntry < Beta [ ] > , isReportArchived = false ) : boolean {
78687868 // Include archived rooms
78697869 // This will get removed as part of https://github.com/Expensify/App/issues/59961
78707870 // eslint-disable-next-line deprecation/deprecation
7871- if ( isArchivedNonExpenseReport ( report , ! ! getReportNameValuePairs ( report ?. reportID ) ?. private_isArchived ) ) {
7871+ if ( isArchivedNonExpenseReport ( report , isReportArchived ) ) {
78727872 return true ;
78737873 }
78747874
@@ -7886,9 +7886,9 @@ function canSeeDefaultRoom(report: OnyxEntry<Report>, betas: OnyxEntry<Beta[]>):
78867886 return Permissions . isBetaEnabled ( CONST . BETAS . DEFAULT_ROOMS , betas ?? [ ] ) ;
78877887}
78887888
7889- function canAccessReport ( report : OnyxEntry < Report > , betas : OnyxEntry < Beta [ ] > ) : boolean {
7889+ function canAccessReport ( report : OnyxEntry < Report > , betas : OnyxEntry < Beta [ ] > , isReportArchived = false ) : boolean {
78907890 // We hide default rooms (it's basically just domain rooms now) from people who aren't on the defaultRooms beta.
7891- if ( isDefaultRoom ( report ) && ! canSeeDefaultRoom ( report , betas ) ) {
7891+ if ( isDefaultRoom ( report ) && ! canSeeDefaultRoom ( report , betas , isReportArchived ) ) {
78927892 return false ;
78937893 }
78947894
@@ -8199,7 +8199,7 @@ function reasonForReportToBeInOptionList({
81998199 return null ;
82008200 }
82018201
8202- if ( ! canAccessReport ( report , betas ) ) {
8202+ if ( ! canAccessReport ( report , betas , isReportArchived ) ) {
82038203 return null ;
82048204 }
82058205
@@ -9291,8 +9291,8 @@ function isReportParticipant(accountID: number | undefined, report: OnyxEntry<Re
92919291/**
92929292 * Check to see if the current user has access to view the report.
92939293 */
9294- function canCurrentUserOpenReport ( report : OnyxEntry < Report > ) : boolean {
9295- return ( isReportParticipant ( currentUserAccountID , report ) || isPublicRoom ( report ) ) && canAccessReport ( report , allBetas ) ;
9294+ function canCurrentUserOpenReport ( report : OnyxEntry < Report > , isReportArchived = false ) : boolean {
9295+ return ( isReportParticipant ( currentUserAccountID , report ) || isPublicRoom ( report ) ) && canAccessReport ( report , allBetas , isReportArchived ) ;
92969296}
92979297
92989298function shouldUseFullTitleToDisplay ( report : OnyxEntry < Report > ) : boolean {
0 commit comments