File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -298,11 +298,15 @@ export default class CanvasPatcher extends Patcher {
298
298
} ) ] )
299
299
300
300
// Canvas is now patched - update all open canvas views
301
- this . plugin . app . workspace . iterateAllLeaves ( ( leaf : WorkspaceLeaf ) => {
301
+ this . plugin . app . workspace . iterateAllLeaves ( async ( leaf : WorkspaceLeaf ) => {
302
302
if ( leaf . view . getViewType ( ) !== 'canvas' ) return
303
303
304
304
const canvasView = leaf . view as any as Omit < CanvasView , 'onClose' > & { onClose : ( ) => void }
305
- const hasChangesToSave = canvasView . lastSavedData !== canvasView . data
305
+ const currentData = canvasView . getViewData ( )
306
+ const savedData = canvasView . file ? await this . plugin . app . vault . read ( canvasView . file ) : null
307
+ const hasChangesToSave = currentData !== savedData
308
+
309
+ console . debug ( `Reloading canvas view (Saving: ${ hasChangesToSave } )` )
306
310
307
311
// Skip saving the canvas data if there are no changes to save (Remote sync compatibility)
308
312
const originalOnClose = canvasView . onClose
You can’t perform that action at this time.
0 commit comments