Skip to content

Commit

Permalink
refactor(deeplinks): add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
satish-ravi committed Dec 10, 2024
1 parent dbbb667 commit a0c769a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/useDeepLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export const useDeepLinks = () => {
Logger.info('useDeepLinks/handleOpenURL', 'Ignoring dynamic link', event.url)
return
}

Logger.debug(

Check warning on line 36 in src/app/useDeepLinks.ts

View check run for this annotation

Codecov / codecov/patch

src/app/useDeepLinks.ts#L36

Added line #L36 was not covered by tests
'useDeepLinks/handleOpenURL',
`Handling url: ${event.url}, isSecureOrigin: ${isSecureOrigin}, shouldConsumeDeepLinks: ${shouldConsumeDeepLinks}`
)
// defer consuming deep links until the user has completed onboarding
if (shouldConsumeDeepLinks) {
dispatch(openDeepLink(event.url, isSecureOrigin))
Expand All @@ -44,6 +47,7 @@ export const useDeepLinks = () => {

useEffect(() => {
if (pendingDeepLink && shouldConsumeDeepLinks) {
Logger.debug('useDeepLinks/useEffect', 'Consuming pending deep link', pendingDeepLink.url)

Check warning on line 50 in src/app/useDeepLinks.ts

View check run for this annotation

Codecov / codecov/patch

src/app/useDeepLinks.ts#L50

Added line #L50 was not covered by tests
dispatch(openDeepLink(pendingDeepLink.url, pendingDeepLink.isSecureOrigin))
}
}, [pendingDeepLink, address, hasVisitedHome])
Expand All @@ -64,7 +68,7 @@ export const useDeepLinks = () => {
CleverTap.getInitialUrl(async (err: any, url: string) => {
if (err) {
if (/CleverTap initialUrl is (nil|null)/gi.test(err)) {
Logger.warn('useDeepLinks/useAsync', 'CleverTap InitialUrl is nil|null', err)
Logger.debug('useDeepLinks/useAsync', 'CleverTap InitialUrl is nil|null', err)

Check warning on line 71 in src/app/useDeepLinks.ts

View check run for this annotation

Codecov / codecov/patch

src/app/useDeepLinks.ts#L71

Added line #L71 was not covered by tests
} else {
Logger.error('useDeepLinks/useAsync', 'App CleverTap Deeplink on Load', err)
}
Expand Down

0 comments on commit a0c769a

Please sign in to comment.