|
|
|
@ -28,6 +28,7 @@ import { SAVE_TO_LOCAL_STORAGE_TIMEOUT } from "./app_constants";
|
|
|
|
|
import { EVENT_LOAD, EVENT_SHARE, trackEvent } from "../analytics";
|
|
|
|
|
import { ErrorDialog } from "../components/ErrorDialog";
|
|
|
|
|
import { getDefaultAppState } from "../appState";
|
|
|
|
|
import { APP_NAME, TITLE_TIMEOUT } from "../constants";
|
|
|
|
|
|
|
|
|
|
const excalidrawRef: React.MutableRefObject<
|
|
|
|
|
MarkRequired<ExcalidrawAPIRefValue, "ready" | "readyPromise">
|
|
|
|
@ -118,7 +119,7 @@ const initializeScene = async (opts: {
|
|
|
|
|
scene = await loadScene(jsonMatch[1], jsonMatch[2], initialData);
|
|
|
|
|
}
|
|
|
|
|
if (!isCollabScene) {
|
|
|
|
|
window.history.replaceState({}, "Excalidraw", window.location.origin);
|
|
|
|
|
window.history.replaceState({}, APP_NAME, window.location.origin);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// https://github.com/excalidraw/excalidraw/issues/1919
|
|
|
|
@ -137,7 +138,7 @@ const initializeScene = async (opts: {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isCollabScene = false;
|
|
|
|
|
window.history.replaceState({}, "Excalidraw", window.location.origin);
|
|
|
|
|
window.history.replaceState({}, APP_NAME, window.location.origin);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isCollabScene) {
|
|
|
|
@ -246,6 +247,10 @@ function ExcalidrawWrapper(props: { collab: CollabAPI }) {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const titleTimeout = setTimeout(
|
|
|
|
|
() => (document.title = APP_NAME),
|
|
|
|
|
TITLE_TIMEOUT,
|
|
|
|
|
);
|
|
|
|
|
window.addEventListener(EVENT.HASHCHANGE, onHashChange, false);
|
|
|
|
|
window.addEventListener(EVENT.UNLOAD, onBlur, false);
|
|
|
|
|
window.addEventListener(EVENT.BLUR, onBlur, false);
|
|
|
|
@ -253,6 +258,7 @@ function ExcalidrawWrapper(props: { collab: CollabAPI }) {
|
|
|
|
|
window.removeEventListener(EVENT.HASHCHANGE, onHashChange, false);
|
|
|
|
|
window.removeEventListener(EVENT.UNLOAD, onBlur, false);
|
|
|
|
|
window.removeEventListener(EVENT.BLUR, onBlur, false);
|
|
|
|
|
clearTimeout(titleTimeout);
|
|
|
|
|
};
|
|
|
|
|
}, [collab.initializeSocketClient]);
|
|
|
|
|
|
|
|
|
|