[Statsig] Send prev route name (#3456)
parent
c300d4cab6
commit
d89b6eb7fd
|
@ -539,8 +539,10 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
|
||||||
const theme = useColorSchemeStyle(DefaultTheme, DarkTheme)
|
const theme = useColorSchemeStyle(DefaultTheme, DarkTheme)
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
const {openModal} = useModalControls()
|
const {openModal} = useModalControls()
|
||||||
|
const prevLoggedRouteName = React.useRef<string | undefined>(undefined)
|
||||||
|
|
||||||
function onReady() {
|
function onReady() {
|
||||||
|
prevLoggedRouteName.current = getCurrentRouteName()
|
||||||
initAnalytics(currentAccount)
|
initAnalytics(currentAccount)
|
||||||
|
|
||||||
if (currentAccount && shouldRequestEmailConfirmation(currentAccount)) {
|
if (currentAccount && shouldRequestEmailConfirmation(currentAccount)) {
|
||||||
|
@ -555,7 +557,10 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
|
||||||
linking={LINKING}
|
linking={LINKING}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
onStateChange={() => {
|
onStateChange={() => {
|
||||||
logEvent('router:navigate', {})
|
logEvent('router:navigate', {
|
||||||
|
from: prevLoggedRouteName.current,
|
||||||
|
})
|
||||||
|
prevLoggedRouteName.current = getCurrentRouteName()
|
||||||
}}
|
}}
|
||||||
onReady={() => {
|
onReady={() => {
|
||||||
attachRouteToLogEvents(getCurrentRouteName)
|
attachRouteToLogEvents(getCurrentRouteName)
|
||||||
|
|
Loading…
Reference in New Issue