Skip to content

Commit 4148ccb

Browse files
committed
fix: not here page appears briefly when user switches account
1 parent f1fe459 commit 4148ccb

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/hooks/useSubscriptionPlan.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import useOnyx from './useOnyx';
77

88
function useSubscriptionPlan() {
99
const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
10-
const [session] = useOnyx(ONYXKEYS.SESSION);
10+
const [userMetadata] = useOnyx(ONYXKEYS.USER_METADATA);
1111

1212
// Filter workspaces in which user is the owner and the type is either corporate (control) or team (collect)
13-
const ownerPolicies = useMemo(() => getOwnedPaidPolicies(policies, session?.accountID ?? -1), [policies, session?.accountID]);
13+
const ownerPolicies = useMemo(() => getOwnedPaidPolicies(policies, userMetadata?.accountID ?? -1), [policies, userMetadata?.accountID]);
1414

1515
if (isEmptyObject(ownerPolicies)) {
1616
return null;

src/libs/actions/Delegate.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const KEYS_TO_PRESERVE_DELEGATE_ACCESS = [
6767
ONYXKEYS.ARE_TRANSLATIONS_LOADING,
6868
ONYXKEYS.SESSION,
6969
ONYXKEYS.STASHED_SESSION,
70-
ONYXKEYS.IS_LOADING_APP,
7170
ONYXKEYS.HAS_LOADED_APP,
7271
ONYXKEYS.STASHED_CREDENTIALS,
7372

src/pages/settings/Subscription/SubscriptionSettingsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function SubscriptionSettingsPage({route}: SubscriptionSettingsPageProps) {
3333
useEffect(() => {
3434
openSubscriptionPage();
3535
}, []);
36-
const [isAppLoading] = useOnyx(ONYXKEYS.IS_LOADING_APP, {canBeMissing: false});
36+
const [isAppLoading = true] = useOnyx(ONYXKEYS.IS_LOADING_APP, {canBeMissing: false});
3737

3838
if (!subscriptionPlan && isAppLoading) {
3939
return <FullScreenLoadingIndicator />;

0 commit comments

Comments
 (0)