1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-24 13:43:12 +02:00

fix: don't send multiple ViewBoard telemetries (#4117)

This commit is contained in:
Paul Esch-Laurent 2022-11-01 22:15:32 -04:00 committed by GitHub
parent 7b2269d06b
commit df1b32cdfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,8 @@ const CenterPanel = (props: Props) => {
const currentCard = useAppSelector(getCurrentCard)
const dispatch = useAppDispatch()
// empty dependency array yields behavior like `componentDidMount`, it only runs _once_
// https://stackoverflow.com/a/58579462
useEffect(() => {
TelemetryClient.trackEvent(TelemetryCategory, TelemetryActions.ViewBoard, {board: props.board.id, view: props.activeView.id, viewType: props.activeView.fields.viewType})
}, [])
@ -247,7 +249,6 @@ const CenterPanel = (props: Props) => {
}, [prepareBoardsTour, shouldStartBoardsTour])
useEffect(() => {
TelemetryClient.trackEvent(TelemetryCategory, TelemetryActions.ViewBoard, {board: props.board.id, view: props.activeView.id, viewType: props.activeView.fields.viewType})
startBoardsTour()
})