diff --git a/src/lib/hooks/useIntentHandler.ts b/src/lib/hooks/useIntentHandler.ts index a33aff2371..9fd72154c4 100644 --- a/src/lib/hooks/useIntentHandler.ts +++ b/src/lib/hooks/useIntentHandler.ts @@ -2,6 +2,7 @@ import React from 'react' import * as Linking from 'expo-linking' import {logEvent} from '#/lib/statsig/statsig' +import {logger} from '#/logger' import {isNative} from '#/platform/detection' import {useSession} from '#/state/session' import {useComposerControls} from '#/state/shell' @@ -73,6 +74,9 @@ export function useIntentHandler() { if (incomingUrl) { if (previousIntentUrl === incomingUrl) { + logger.debug(`useIntentHandler: ignoring duplicate incoming URL`, { + incomingUrl, + }) return } handleIncomingURL(incomingUrl) diff --git a/src/state/dialogs/index.tsx b/src/state/dialogs/index.tsx index f770e9c169..f1172da35a 100644 --- a/src/state/dialogs/index.tsx +++ b/src/state/dialogs/index.tsx @@ -1,9 +1,7 @@ import React from 'react' -import {isWeb} from '#/platform/detection' -import {DialogControlRefProps} from '#/components/Dialog' +import {type DialogControlRefProps} from '#/components/Dialog' import {Provider as GlobalDialogsProvider} from '#/components/dialogs/Context' -import {BottomSheetNativeComponent} from '../../../modules/bottom-sheet' interface IDialogContext { /** @@ -53,17 +51,15 @@ export function Provider({children}: React.PropsWithChildren<{}>) { const openDialogs = React.useRef>(new Set()) const closeAllDialogs = React.useCallback(() => { - if (isWeb) { - openDialogs.current.forEach(id => { - const dialog = activeDialogs.current.get(id) - if (dialog) dialog.current.close() - }) + openDialogs.current.forEach(id => { + const dialog = activeDialogs.current.get(id) + if (dialog) { + dialog.current.close() + openDialogs.current.delete(id) + } + }) - return openDialogs.current.size > 0 - } else { - BottomSheetNativeComponent.dismissAll() - return false - } + return openDialogs.current.size > 0 }, []) const setDialogIsOpen = React.useCallback((id: string, isOpen: boolean) => {