-
Notifications
You must be signed in to change notification settings - Fork 3.9k
track 404 page #76629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
track 404 page #76629
Changes from all commits
8c94a8a
03a710c
a81c050
ff7354c
0e3ad7d
f41e410
e8f6b1e
187c616
d243d59
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import {useContext, useEffect} from 'react'; | ||
| import {Platform} from 'react-native'; | ||
| import {InitialURLContext} from '@components/InitialURLContextProvider'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import CONST from '@src/CONST'; | ||
| import {endSpan, startSpan} from './activeSpans'; | ||
|
|
||
| export default function useAbsentPageSpan() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we rename this to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did it and than got es lint error because it not allow to use negative names..
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh...okay then 😄
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eslint does not allow negativity in the code. I'd personally use After some time it'll be hard to remember what is At least write a comment doc about what this is :) |
||
| const {initialURL} = useContext(InitialURLContext); | ||
|
|
||
| useEffect(() => { | ||
| let isDeeplink = false; | ||
| let currentUrl = ''; | ||
|
|
||
| if (Platform.OS === 'web') { | ||
| currentUrl = window.location.href; | ||
| isDeeplink = currentUrl === initialURL; | ||
| } else { | ||
| isDeeplink = !!initialURL; | ||
| currentUrl = Navigation.getActiveRoute() || ''; | ||
| } | ||
|
|
||
| const NAVIGATION_SOURCE = isDeeplink ? 'deeplink' : 'button'; | ||
|
|
||
| startSpan(CONST.TELEMETRY.SPAN_NOT_FOUND_PAGE, { | ||
| name: CONST.TELEMETRY.SPAN_NOT_FOUND_PAGE, | ||
| op: CONST.TELEMETRY.SPAN_NOT_FOUND_PAGE, | ||
| attributes: { | ||
| url: currentUrl, | ||
| navigationSource: NAVIGATION_SOURCE, | ||
| }, | ||
| }); | ||
|
|
||
| endSpan(CONST.TELEMETRY.SPAN_NOT_FOUND_PAGE); | ||
| }, [initialURL]); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move file to
src/libs/telemetryThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done