feat: Track current version (#2731)

This commit is contained in:
Lipis 2021-01-10 20:48:12 +02:00 committed by GitHub
parent 3a130cb102
commit 001880ba88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 13 deletions

View file

@ -6,6 +6,7 @@ import React, {
useRef,
useState,
} from "react";
import { trackEvent } from "../analytics";
import { getDefaultAppState } from "../appState";
import { ExcalidrawImperativeAPI } from "../components/App";
import { ErrorDialog } from "../components/ErrorDialog";
@ -22,7 +23,12 @@ import Excalidraw, {
languages,
} from "../packages/excalidraw/index";
import { AppState, ExcalidrawAPIRefValue } from "../types";
import { debounce, ResolvablePromise, resolvablePromise } from "../utils";
import {
debounce,
getVersion,
ResolvablePromise,
resolvablePromise,
} from "../utils";
import { SAVE_TO_LOCAL_STORAGE_TIMEOUT } from "./app_constants";
import CollabWrapper, { CollabAPI } from "./collab/CollabWrapper";
import { LanguageList } from "./components/LanguageList";
@ -223,6 +229,7 @@ function ExcalidrawWrapper(props: { collab: CollabAPI }) {
const { collab } = props;
useEffect(() => {
trackEvent("load", "version", getVersion());
excalidrawRef.current!.readyPromise.then((excalidrawApi) => {
initializeScene({
resetScene: excalidrawApi.resetScene,