diff --git a/src/ExcalidrawView.ts b/src/ExcalidrawView.ts index 163b9cd5..8f7b8f39 100644 --- a/src/ExcalidrawView.ts +++ b/src/ExcalidrawView.ts @@ -39,6 +39,10 @@ export default class ExcalidrawView extends TextFileView { else return this.data; } + async onunload() { + if(this.excalidrawRef) await this.save(); + } + setViewData (data: string, clear: boolean) { if (this.app.workspace.layoutReady) { this.loadDrawing(data,clear);