Skip to content

Commit

Permalink
dont take user to token list
Browse files Browse the repository at this point in the history
  • Loading branch information
ruijialin-avalabs committed Jan 10, 2025
1 parent f60774e commit 578806c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/core-mobile/app/services/fcm/FCMService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class FCMService {
}
}

private skipWcLink = (link: string): boolean => {
private shouldSkipDeeplink = (link: string): boolean => {
let url
try {
url = new URL(link)
Expand All @@ -151,7 +151,8 @@ class FCMService {
protocol === PROTOCOLS.WC ||
(protocol === PROTOCOLS.HTTPS &&
CORE_UNIVERSAL_LINK_HOSTS.includes(url.hostname) &&
url.pathname.split('/')[1] === ACTIONS.WC)
url.pathname.split('/')[1] === ACTIONS.WC) ||
(protocol === PROTOCOLS.CORE && url.host === ACTIONS.Portfolio)
)
}

Expand All @@ -167,15 +168,15 @@ class FCMService {
}
const notificationData = this.#prepareNotificationData(result.data)

// walletconnect deeplink should not be handled here
if (
notificationData.data?.url === undefined ||
typeof notificationData.data.url !== 'string'
) {
return
}

if (this.skipWcLink(notificationData.data.url)) {
// we simply take user to portfolio/home page if the url is walletconnect or balanche-change events
if (this.shouldSkipDeeplink(notificationData.data.url)) {
return
}

Expand Down

0 comments on commit 578806c

Please sign in to comment.