Skip to content

Commit

Permalink
fix: auto-sign not redirecting back to browser
Browse files Browse the repository at this point in the history
  • Loading branch information
akalogerakisunicorn committed Dec 9, 2024
1 parent ef41173 commit c4c33e5
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/composables/deepLinkApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,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');
}
}, 300);
}

return {
Expand Down

0 comments on commit c4c33e5

Please sign in to comment.