Skip to content

Commit 7d518bc

Browse files
authored
Merge pull request Expensify#65424 from bernhardoj/fix/64638-login-page-shows-briefly-when-open-public-room-as-anon-user
#2 - Fix login page shows briefly when open public room as anon user
2 parents f660f73 + 5c3d5c3 commit 7d518bc

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/Expensify.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function Expensify() {
9494
const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: true});
9595
const [lastRoute] = useOnyx(ONYXKEYS.LAST_ROUTE, {canBeMissing: true});
9696
const [userMetadata] = useOnyx(ONYXKEYS.USER_METADATA, {canBeMissing: true});
97-
const [isCheckingPublicRoom] = useOnyx(ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, {initWithStoredValues: false, canBeMissing: true});
97+
const [isCheckingPublicRoom = true] = useOnyx(ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, {initWithStoredValues: false, canBeMissing: true});
9898
const [updateAvailable] = useOnyx(ONYXKEYS.UPDATE_AVAILABLE, {initWithStoredValues: false, canBeMissing: true});
9999
const [updateRequired] = useOnyx(ONYXKEYS.UPDATE_REQUIRED, {initWithStoredValues: false, canBeMissing: true});
100100
const [isSidebarLoaded] = useOnyx(ONYXKEYS.IS_SIDEBAR_LOADED, {canBeMissing: true});
@@ -205,6 +205,7 @@ function Expensify() {
205205
Linking.getInitialURL().then((url) => {
206206
// We use custom deeplink handler in setup/hybridApp
207207
if (CONFIG.IS_HYBRID_APP) {
208+
Report.doneCheckingPublicRoom();
208209
return;
209210
}
210211
setInitialUrl(url);

src/libs/actions/Report.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3356,6 +3356,10 @@ function toggleEmojiReaction(
33563356
addEmojiReaction(originalReportID, reportAction.reportActionID, emoji, skinTone);
33573357
}
33583358

3359+
function doneCheckingPublicRoom() {
3360+
Onyx.set(ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, false);
3361+
}
3362+
33593363
function openReportFromDeepLink(url: string) {
33603364
const reportID = getReportIDFromLink(url);
33613365
const isAuthenticated = hasAuthToken();
@@ -3366,11 +3370,11 @@ function openReportFromDeepLink(url: string) {
33663370

33673371
// Show the sign-in page if the app is offline
33683372
if (networkStatus === CONST.NETWORK.NETWORK_STATUS.OFFLINE) {
3369-
Onyx.set(ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, false);
3373+
doneCheckingPublicRoom();
33703374
}
33713375
} else {
33723376
// If we're not opening a public room (no reportID) or the user is authenticated, we unblock the UI (hide splash screen)
3373-
Onyx.set(ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, false);
3377+
doneCheckingPublicRoom();
33743378
}
33753379

33763380
let route = getRouteFromLink(url);
@@ -5774,6 +5778,7 @@ export {
57745778
deleteReportComment,
57755779
deleteReportField,
57765780
dismissTrackExpenseActionableWhisper,
5781+
doneCheckingPublicRoom,
57775782
downloadReportPDF,
57785783
editReportComment,
57795784
expandURLPreview,

0 commit comments

Comments
 (0)