From 15b400a3d9019eed6cbc7af424a73dd0019aff08 Mon Sep 17 00:00:00 2001 From: zsviczian Date: Tue, 3 Sep 2024 13:11:22 +0200 Subject: [PATCH] 2.4.1 --- manifest-beta.json | 2 +- manifest.json | 2 +- src/ExcalidrawView.ts | 11 ++++++++++- src/lang/locale/en.ts | 2 ++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/manifest-beta.json b/manifest-beta.json index 0957364..033d76b 100644 --- a/manifest-beta.json +++ b/manifest-beta.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "2.4.1-rc-1", + "version": "2.4.1", "minAppVersion": "1.1.6", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/manifest.json b/manifest.json index 7ece513..9119efc 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-excalidraw-plugin", "name": "Excalidraw", - "version": "2.4.0", + "version": "2.4.1", "minAppVersion": "1.1.6", "description": "An Obsidian plugin to edit and view Excalidraw drawings", "author": "Zsolt Viczian", diff --git a/src/ExcalidrawView.ts b/src/ExcalidrawView.ts index 758e0bf..827426d 100644 --- a/src/ExcalidrawView.ts +++ b/src/ExcalidrawView.ts @@ -1782,7 +1782,16 @@ export default class ExcalidrawView extends TextFileView { async onUnloadFile(file: TFile): Promise { //deliberately not calling super.onUnloadFile() to avoid autosave (saved in unload) (process.env.NODE_ENV === 'development') && DEBUGGING && debug(this.onUnloadFile,`ExcalidrawView.onUnloadFile, file:${this.file?.name}`); - while (this.semaphores.saving) await sleep(50); //https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1988 + let counter = 0; + while (this.semaphores.saving) { + await sleep(50); //https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1988 + if(counter++ === 15) { + new Notice(t("SAVE_IS_TAKING_LONG")); + } + if(counter === 80) { + new Notice(t("SAVE_IS_TAKING_VERY_LONG")); + } + } } private async forceSaveIfRequired():Promise { diff --git a/src/lang/locale/en.ts b/src/lang/locale/en.ts index 8589fed..b79ee64 100644 --- a/src/lang/locale/en.ts +++ b/src/lang/locale/en.ts @@ -169,6 +169,8 @@ export default { WELCOME_LEARN_LINK: "Sign up for the Visual Thinking Workshop", WELCOME_DONATE_ARIA: "Donate to support Excalidraw-Obsidian", WELCOME_DONATE_LINK: 'Say "Thank You" & support the plugin.', + SAVE_IS_TAKING_LONG: "Saving your previous file is taking a long time. Please wait...", + SAVE_IS_TAKING_VERY_LONG: "For better performance, consider splitting large drawings into several smaller files.", //settings.ts RELEASE_NOTES_NAME: "Display Release Notes after update",