mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix: don't prompt on empty scenes (#2937)
This commit is contained in:
parent
dc25fe06d0
commit
b79ef0d428
1 changed files with 8 additions and 1 deletions
|
@ -80,7 +80,14 @@ const initializeScene = async (opts: {
|
||||||
let roomLinkData = getCollaborationLinkData(window.location.href);
|
let roomLinkData = getCollaborationLinkData(window.location.href);
|
||||||
const isExternalScene = !!(id || jsonMatch || roomLinkData);
|
const isExternalScene = !!(id || jsonMatch || roomLinkData);
|
||||||
if (isExternalScene) {
|
if (isExternalScene) {
|
||||||
if (roomLinkData || window.confirm(t("alerts.loadSceneOverridePrompt"))) {
|
if (
|
||||||
|
// don't prompt if scene is empty
|
||||||
|
!scene.elements.length ||
|
||||||
|
// don't prompt for collab scenes because we don't override local storage
|
||||||
|
roomLinkData ||
|
||||||
|
// otherwise, prompt whether user wants to override current scene
|
||||||
|
window.confirm(t("alerts.loadSceneOverridePrompt"))
|
||||||
|
) {
|
||||||
// Backwards compatibility with legacy url format
|
// Backwards compatibility with legacy url format
|
||||||
if (id) {
|
if (id) {
|
||||||
scene = await loadScene(id, null, initialData);
|
scene = await loadScene(id, null, initialData);
|
||||||
|
|
Loading…
Add table
Reference in a new issue