chore: Track collaboration (#3211)
This commit is contained in:
parent
1bb3d71d22
commit
bb612fd768
@ -40,6 +40,7 @@ import { createInverseContext } from "../../createInverseContext";
|
|||||||
import { t } from "../../i18n";
|
import { t } from "../../i18n";
|
||||||
import { UserIdleState } from "./types";
|
import { UserIdleState } from "./types";
|
||||||
import { IDLE_THRESHOLD, ACTIVE_THRESHOLD } from "../../constants";
|
import { IDLE_THRESHOLD, ACTIVE_THRESHOLD } from "../../constants";
|
||||||
|
import { trackEvent } from "../../analytics";
|
||||||
|
|
||||||
interface CollabState {
|
interface CollabState {
|
||||||
modalIsShown: boolean;
|
modalIsShown: boolean;
|
||||||
@ -188,6 +189,7 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
openPortal = async () => {
|
openPortal = async () => {
|
||||||
|
trackEvent("share", "room creation");
|
||||||
return this.initializeSocketClient(null);
|
return this.initializeSocketClient(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -196,6 +198,7 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
|
|||||||
if (window.confirm(t("alerts.collabStopOverridePrompt"))) {
|
if (window.confirm(t("alerts.collabStopOverridePrompt"))) {
|
||||||
window.history.pushState({}, APP_NAME, window.location.origin);
|
window.history.pushState({}, APP_NAME, window.location.origin);
|
||||||
this.destroySocketClient();
|
this.destroySocketClient();
|
||||||
|
trackEvent("share", "room closed");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import { getSyncableElements } from "../../packages/excalidraw/index";
|
|||||||
import { ExcalidrawElement } from "../../element/types";
|
import { ExcalidrawElement } from "../../element/types";
|
||||||
import { BROADCAST, SCENE } from "../app_constants";
|
import { BROADCAST, SCENE } from "../app_constants";
|
||||||
import { UserIdleState } from "./types";
|
import { UserIdleState } from "./types";
|
||||||
|
import { trackEvent } from "../../analytics";
|
||||||
|
|
||||||
class Portal {
|
class Portal {
|
||||||
collab: CollabWrapper;
|
collab: CollabWrapper;
|
||||||
@ -32,6 +33,7 @@ class Portal {
|
|||||||
this.socket.on("init-room", () => {
|
this.socket.on("init-room", () => {
|
||||||
if (this.socket) {
|
if (this.socket) {
|
||||||
this.socket.emit("join-room", this.roomId);
|
this.socket.emit("join-room", this.roomId);
|
||||||
|
trackEvent("share", "room joined");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.socket.on("new-user", async (_socketId: string) => {
|
this.socket.on("new-user", async (_socketId: string) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user