Virtual whiteboard for sketching hand-drawn like diagrams
chore: Track collaboration (#3211)
Lipisbb612fd76857
diff --git a/src/excalidraw-app/collab/CollabWrapper.tsx b/src/excalidraw-app/collab/CollabWrapper.tsxindex c6ffdf95e9..09bb9bbeb9 100644--- a/src/excalidraw-app/collab/CollabWrapper.tsx+++ b/src/excalidraw-app/collab/CollabWrapper.tsx@@ -40,6 +40,7 @@ import { createInverseContext } from "../../createInverseContext";import { t } from "../../i18n";import { UserIdleState } from "./types";import { IDLE_THRESHOLD, ACTIVE_THRESHOLD } from "../../constants";+import { trackEvent } from "../../analytics";interface CollabState {modalIsShown: boolean;@@ -188,6 +189,7 @@ class CollabWrapper extends PureComponent<Props, CollabState> {};openPortal = async () => {+ trackEvent("share", "room creation");return this.initializeSocketClient(null);};@@ -196,6 +198,7 @@ class CollabWrapper extends PureComponent<Props, CollabState> {if (window.confirm(t("alerts.collabStopOverridePrompt"))) {window.history.pushState({}, APP_NAME, window.location.origin);this.destroySocketClient();+ trackEvent("share", "room closed");}};diff --git a/src/excalidraw-app/collab/Portal.tsx b/src/excalidraw-app/collab/Portal.tsxindex 091f395f98..b79f20ef93 100644--- a/src/excalidraw-app/collab/Portal.tsx+++ b/src/excalidraw-app/collab/Portal.tsx@@ -10,6 +10,7 @@ import { getSyncableElements } from "../../packages/excalidraw/index";import { ExcalidrawElement } from "../../element/types";import { BROADCAST, SCENE } from "../app_constants";import { UserIdleState } from "./types";+import { trackEvent } from "../../analytics";class Portal {collab: CollabWrapper;@@ -32,6 +33,7 @@ class Portal {this.socket.on("init-room", () => {if (this.socket) {this.socket.emit("join-room", this.roomId);+ trackEvent("share", "room joined");}});this.socket.on("new-user", async (_socketId: string) => {