Refactor canvas preview visibility and widget loading

Refactored Canvas.js to use an async waitForWidget method for reliably finding widgets before manipulating them. The setPreviewVisibility method is now async and simplified, with excessive debug logging removed. CanvasState.js now triggers a render after saving state. In CanvasView.js, initial state loading is deferred and preview visibility is managed in the Canvas constructor, removing redundant calls.
This commit is contained in:
Dariusz L
2025-07-01 06:32:06 +02:00
parent 40c1dbfb5d
commit 30fb89451f
3 changed files with 37 additions and 70 deletions

View File

@@ -216,6 +216,7 @@ export class CanvasState {
await setCanvasState(this.canvas.node.id, state);
log.info("Canvas state saved to IndexedDB.");
this.lastSavedStateSignature = currentStateSignature;
this.canvas.render();
}, 'CanvasState.saveStateToDB');
if (immediate) {