From bbcf3985b31eef638140c2ac4d089ddc08b82f9b Mon Sep 17 00:00:00 2001 From: Nikita Date: Fri, 29 Sep 2023 15:15:02 +0400 Subject: [PATCH] fix: be able to open a tip deeplink on mobile --- src/composables/deepLinkApi.ts | 9 +++++++-- src/popup/pages/Dashboard.vue | 16 +++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/composables/deepLinkApi.ts b/src/composables/deepLinkApi.ts index fbd25df98..a54f29b47 100644 --- a/src/composables/deepLinkApi.ts +++ b/src/composables/deepLinkApi.ts @@ -3,6 +3,8 @@ import { Router, RouteLocationNormalized as Route, } from 'vue-router'; + +import { ROUTE_ACCOUNT } from '@/popup/router/routeNames'; import { checkIfSuperheroCallbackUrl } from '@/utils'; import { MODAL_TRANSFER_SEND } from '@/constants'; import { useModals } from '@/composables/modals'; @@ -26,8 +28,11 @@ export function useDeepLinkApi({ router }: UseDeepLinkApiOptions) { /** * Function needed to support legacy tipping from superhero.com */ - function checkIfOpenTransferSendModal() { - if (checkIfSuperheroCallbackUrl(route.query)) { + async function checkIfOpenTransferSendModal(currentRoute: Route) { + if ( + currentRoute.path.slice(1) === ROUTE_ACCOUNT + && checkIfSuperheroCallbackUrl(currentRoute.query) + ) { const { openModal } = useModals(); openModal(MODAL_TRANSFER_SEND); diff --git a/src/popup/pages/Dashboard.vue b/src/popup/pages/Dashboard.vue index 5be1028b3..695c3cfab 100644 --- a/src/popup/pages/Dashboard.vue +++ b/src/popup/pages/Dashboard.vue @@ -51,9 +51,9 @@