fix: Count all versions (#2798)
This commit is contained in:
parent
ee703206b0
commit
c799b28a0e
@ -90,3 +90,4 @@ export const TAP_TWICE_TIMEOUT = 300;
|
|||||||
export const TOUCH_CTX_MENU_TIMEOUT = 500;
|
export const TOUCH_CTX_MENU_TIMEOUT = 500;
|
||||||
export const TITLE_TIMEOUT = 10000;
|
export const TITLE_TIMEOUT = 10000;
|
||||||
export const TOAST_TIMEOUT = 5000;
|
export const TOAST_TIMEOUT = 5000;
|
||||||
|
export const VERSION_TIMEOUT = 15000;
|
||||||
|
@ -11,7 +11,7 @@ import { getDefaultAppState } from "../appState";
|
|||||||
import { ExcalidrawImperativeAPI } from "../components/App";
|
import { ExcalidrawImperativeAPI } from "../components/App";
|
||||||
import { ErrorDialog } from "../components/ErrorDialog";
|
import { ErrorDialog } from "../components/ErrorDialog";
|
||||||
import { TopErrorBoundary } from "../components/TopErrorBoundary";
|
import { TopErrorBoundary } from "../components/TopErrorBoundary";
|
||||||
import { APP_NAME, EVENT, TITLE_TIMEOUT } from "../constants";
|
import { APP_NAME, EVENT, TITLE_TIMEOUT, VERSION_TIMEOUT } from "../constants";
|
||||||
import { ImportedDataState } from "../data/types";
|
import { ImportedDataState } from "../data/types";
|
||||||
import {
|
import {
|
||||||
ExcalidrawElement,
|
ExcalidrawElement,
|
||||||
@ -229,18 +229,10 @@ function ExcalidrawWrapper(props: { collab: CollabAPI }) {
|
|||||||
const { collab } = props;
|
const { collab } = props;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// delayed by 15 sec so that the app has a time to load the latest SW
|
// Delayed so that the app has a time to load the latest SW
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const version = getVersion();
|
trackEvent("load", "version", getVersion());
|
||||||
const loggedVersion = window.localStorage.getItem(
|
}, VERSION_TIMEOUT);
|
||||||
"excalidraw-lastLoggedVersion",
|
|
||||||
);
|
|
||||||
// prevent logging on multiple visits
|
|
||||||
if (version && version !== loggedVersion) {
|
|
||||||
window.localStorage.setItem("excalidraw-lastLoggedVersion", version);
|
|
||||||
trackEvent("load", "version", version);
|
|
||||||
}
|
|
||||||
}, 15000);
|
|
||||||
|
|
||||||
excalidrawRef.current!.readyPromise.then((excalidrawApi) => {
|
excalidrawRef.current!.readyPromise.then((excalidrawApi) => {
|
||||||
initializeScene({
|
initializeScene({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user