diff --git a/src/composables/deepLinkApi.ts b/src/composables/deepLinkApi.ts index a426f9d5c..900a3c909 100644 --- a/src/composables/deepLinkApi.ts +++ b/src/composables/deepLinkApi.ts @@ -4,7 +4,12 @@ import { useIonRouter } from '@ionic/vue'; import { ROUTE_ACCOUNT } from '@/popup/router/routeNames'; import { checkIfSuperheroCallbackUrl } from '@/utils'; -import { IS_IOS, IS_MOBILE_APP, MODAL_TRANSFER_SEND } from '@/constants'; +import { + IS_IOS, + IS_MOBILE_APP, + IS_WEB, + MODAL_TRANSFER_SEND, +} from '@/constants'; import { useModals } from '@/composables/modals'; export function useDeepLinkApi() { @@ -45,11 +50,19 @@ export function useDeepLinkApi() { decodeURIComponent(String(route.query[isSuccess ? 'x-success' : 'x-cancel'])), ) as string; router.replace({ name: ROUTE_ACCOUNT }); - if (IS_MOBILE_APP && !IS_IOS) { - window.open(callbackUrl, '_system'); - } else { - window.open(callbackUrl, '_self'); - } + /** + * When auto-sign is enabled (daily spend limit), + * there are cases (mostly on iOS) where it's not redirecting back to the callback URL. + * This might be due to the time it takes for iOS to animate the navigation. + * Adding a small delay fixes this + */ + setTimeout(() => { + if (IS_MOBILE_APP && !IS_IOS) { + window.open(callbackUrl, '_system'); + } else { + window.open(callbackUrl, '_self'); + } + }, IS_WEB ? 0 : 300); } return {