Skip to content

Commit 924814e

Browse files
committed
add pageload effecthook to app
1 parent 3ce6ec8 commit 924814e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/browser/modules/App/App.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ import {
9696
updateUdcData
9797
} from 'shared/modules/udc/udcDuck'
9898
import { getTelemetrySettings } from 'shared/utils/selectors'
99+
import { trackPageLoad } from 'shared/modules/preview/previewDuck'
99100

100101
export const MAIN_WRAPPER_DOM_ID = 'MAIN_WRAPPER_DOM_ID'
101102

@@ -149,6 +150,11 @@ export function App(props: any) {
149150
props.bus && props.bus.send(initAction.type, initAction)
150151
}, [props.bus])
151152

153+
useEffect(() => {
154+
const pageLoadAction = trackPageLoad()
155+
props.bus && props.bus.send(pageLoadAction.type, pageLoadAction)
156+
}, [props.bus, props.telemetrySettings.allowUserStats])
157+
152158
const {
153159
browserSyncAuthStatus,
154160
browserSyncConfig,

0 commit comments

Comments
 (0)