feat: Change title to Excalidraw after a timeout (#2656)

* feat: Change title to Excalidraw after a timeout

* clear timeout
This commit is contained in:
Lipis 2020-12-22 11:34:06 +02:00 committed by GitHub
parent b0eeb8e6e6
commit 6adb45ef5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 10 deletions

View file

@ -1,7 +1,7 @@
import React, { PureComponent } from "react";
import throttle from "lodash.throttle";
import { ENV, EVENT } from "../../constants";
import { APP_NAME, ENV, EVENT } from "../../constants";
import {
decryptAESGEM,
@ -157,11 +157,7 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
};
openPortal = async () => {
window.history.pushState(
{},
"Excalidraw",
await generateCollaborationLink(),
);
window.history.pushState({}, APP_NAME, await generateCollaborationLink());
const elements = this.excalidrawRef.current!.getSceneElements();
// remove deleted elements from elements array & history to ensure we don't
// expose potentially sensitive user data in case user manually deletes
@ -178,7 +174,7 @@ class CollabWrapper extends PureComponent<Props, CollabState> {
closePortal = () => {
this.saveCollabRoomToFirebase();
window.history.pushState({}, "Excalidraw", window.location.origin);
window.history.pushState({}, APP_NAME, window.location.origin);
this.destroySocketClient();
trackEvent(EVENT_SHARE, "session end");
};