diff options
author | dan <dan.abramov@gmail.com> | 2024-04-09 23:09:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-09 15:09:53 -0700 |
commit | d89b6eb7fd731dae320c0ca07e970c81e4de3cad (patch) | |
tree | 4d8fc7ac6528e86d7ff529ac9496e2bd612677e3 /src/Navigation.tsx | |
parent | c300d4cab638405e783eb9e96a6d6a836d4ecd6e (diff) | |
download | voidsky-d89b6eb7fd731dae320c0ca07e970c81e4de3cad.tar.zst |
[Statsig] Send prev route name (#3456)
Diffstat (limited to 'src/Navigation.tsx')
-rw-r--r-- | src/Navigation.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Navigation.tsx b/src/Navigation.tsx index ab40ff422..070c57960 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -539,8 +539,10 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) { const theme = useColorSchemeStyle(DefaultTheme, DarkTheme) const {currentAccount} = useSession() const {openModal} = useModalControls() + const prevLoggedRouteName = React.useRef<string | undefined>(undefined) function onReady() { + prevLoggedRouteName.current = getCurrentRouteName() initAnalytics(currentAccount) if (currentAccount && shouldRequestEmailConfirmation(currentAccount)) { @@ -555,7 +557,10 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) { linking={LINKING} theme={theme} onStateChange={() => { - logEvent('router:navigate', {}) + logEvent('router:navigate', { + from: prevLoggedRouteName.current, + }) + prevLoggedRouteName.current = getCurrentRouteName() }} onReady={() => { attachRouteToLogEvents(getCurrentRouteName) |