Track play-pause usage

Summary: ^

Reviewed By: aigoncharov

Differential Revision: D44169950

fbshipit-source-id: 7a10c6849382680723687a63fd987b9766076af9
This commit is contained in:
Lorenzo Blasa
2023-03-17 10:37:02 -07:00
committed by Facebook GitHub Bot
parent 723bc52c38
commit 9b9674be2d
2 changed files with 43 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ import {
} from './types';
import {Draft} from 'immer';
import {QueryClient, setLogger} from 'react-query';
import {tracker} from './tracker';
type SnapshotInfo = {nodeId: Id; base64Image: Snapshot};
type LiveClientState = {
@@ -156,6 +157,7 @@ export function plugin(client: PluginClient<Events>) {
});
const setPlayPause = (isPaused: boolean) => {
tracker.track('play-pause', {paused: isPaused});
uiState.isPaused.set(isPaused);
if (!isPaused) {
//When going back to play mode then set the atoms to the live state to rerender the latest