diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index d39213943c8..0bb3b30447d 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -46,6 +46,9 @@ const ONYXKEYS = { /** Keeps track if there is modal currently visible or not */ MODAL: 'modal', + /** Keeps track if there is a full screen currently visible or not */ + FULLSCREEN_VISIBILITY: 'fullscreenVisibility', + /** Has information about the network status (offline/online) */ NETWORK: 'network', @@ -910,6 +913,7 @@ type OnyxValuesMapping = { [ONYXKEYS.CREDENTIALS]: OnyxTypes.Credentials; [ONYXKEYS.STASHED_CREDENTIALS]: OnyxTypes.Credentials; [ONYXKEYS.MODAL]: OnyxTypes.Modal; + [ONYXKEYS.FULLSCREEN_VISIBILITY]: boolean; [ONYXKEYS.NETWORK]: OnyxTypes.Network; [ONYXKEYS.NEW_GROUP_CHAT_DRAFT]: OnyxTypes.NewGroupChatDraft; [ONYXKEYS.CUSTOM_STATUS_DRAFT]: OnyxTypes.CustomStatusDraft; diff --git a/src/components/LHNOptionsList/OptionRowLHN.tsx b/src/components/LHNOptionsList/OptionRowLHN.tsx index 2dc93aa8c9c..555ba33937d 100644 --- a/src/components/LHNOptionsList/OptionRowLHN.tsx +++ b/src/components/LHNOptionsList/OptionRowLHN.tsx @@ -59,6 +59,7 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${optionItem?.reportID}`); const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); + const [isFullscreenVisible] = useOnyx(ONYXKEYS.FULLSCREEN_VISIBILITY); const session = useSession(); const shouldShowWokspaceChatTooltip = isPolicyExpenseChat(report) && activePolicyID === report?.policyID && session?.accountID === report?.ownerAccountID; const isOnboardingGuideAssigned = introSelected?.choice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !session?.email?.includes('+'); @@ -68,11 +69,11 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti const {tooltipToRender, shouldShowTooltip} = useMemo(() => { const tooltip = shouldShowGetStartedTooltip ? CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.CONCEIRGE_LHN_GBR : CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.LHN_WORKSPACE_CHAT_TOOLTIP; const shouldShowTooltips = shouldShowWokspaceChatTooltip || shouldShowGetStartedTooltip; - const shouldTooltipBeVisible = shouldUseNarrowLayout ? isScreenFocused && isActiveRouteHome : isActiveRouteHome; + const shouldTooltipBeVisible = shouldUseNarrowLayout ? isScreenFocused && isActiveRouteHome : isActiveRouteHome && !isFullscreenVisible; // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing return {tooltipToRender: tooltip, shouldShowTooltip: shouldShowTooltips && shouldTooltipBeVisible}; - }, [shouldShowGetStartedTooltip, shouldShowWokspaceChatTooltip, isScreenFocused, shouldUseNarrowLayout, isActiveRouteHome]); + }, [shouldShowGetStartedTooltip, shouldShowWokspaceChatTooltip, isScreenFocused, shouldUseNarrowLayout, isActiveRouteHome, isFullscreenVisible]); const {shouldShowProductTrainingTooltip, renderProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext(tooltipToRender, shouldShowTooltip); diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index 8832a3b4287..701042b93aa 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -18,6 +18,7 @@ import usePermissions from '@hooks/usePermissions'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; +import setFullscreenVisibility from '@libs/actions/setFullscreenVisibility'; import {READ_COMMANDS} from '@libs/API/types'; import HttpUtils from '@libs/HttpUtils'; import KeyboardShortcut from '@libs/KeyboardShortcut'; @@ -220,6 +221,15 @@ const modalScreenListeners = { }, }; +const fullScreenListeners = { + focus: () => { + setFullscreenVisibility(true); + }, + beforeRemove: () => { + setFullscreenVisibility(false); + }, +}; + // Extended modal screen listeners with additional cancellation of pending requests const modalScreenListenersWithCancelSearch = { ...modalScreenListeners, @@ -460,6 +470,7 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie headerShown: false, title: 'New Expensify', }} + listeners={fullScreenListeners} getComponent={loadValidateLoginPage} />