Skip to content

Commit

Permalink
Merge branch 'ideal-nav-merge' into @kosmydel/ideal-nav-issues-v7
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmydel committed Jan 31, 2024
2 parents 8391d34 + 9f49c50 commit 69ff971
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Expensify.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import compose from './libs/compose';
import * as Growl from './libs/Growl';
import Log from './libs/Log';
import migrateOnyx from './libs/migrateOnyx';
import Navigation from './libs/Navigation/Navigation';
import getTopmostBottomTabRoute from './libs/Navigation/getTopmostBottomTabRoute';
import Navigation, {navigationRef} from './libs/Navigation/Navigation';
import NavigationRoot from './libs/Navigation/NavigationRoot';
import NetworkConnection from './libs/NetworkConnection';
import PushNotification from './libs/Notification/PushNotification';
Expand All @@ -37,6 +38,7 @@ import Visibility from './libs/Visibility';
import ONYXKEYS from './ONYXKEYS';
import PopoverReportActionContextMenu from './pages/home/report/ContextMenu/PopoverReportActionContextMenu';
import * as ReportActionContextMenu from './pages/home/report/ContextMenu/ReportActionContextMenu';
import SCREENS from './SCREENS';

Onyx.registerLogger(({level, message}) => {
if (level === 'alert') {
Expand Down Expand Up @@ -130,7 +132,16 @@ function Expensify(props) {
[isSplashHidden],
);

const shouldInit = isNavigationReady && (!isAuthenticated || props.isSidebarLoaded) && hasAttemptedToOpenPublicRoom;
// This is a temporary fix to handle more that one possible screen in the sidebar.
const isSidebarLoaded = useMemo(() => {
if (!isNavigationReady) {
return false;
}

return getTopmostBottomTabRoute(navigationRef.getState()).name === SCREENS.HOME ? props.isSidebarLoaded : true;
}, [isNavigationReady, props.isSidebarLoaded]);

const shouldInit = isNavigationReady && (!isAuthenticated || isSidebarLoaded) && hasAttemptedToOpenPublicRoom;
const shouldHideSplash = shouldInit && !isSplashHidden;

const initializeClient = () => {
Expand Down

0 comments on commit 69ff971

Please sign in to comment.