From 86d8411bb9231589894c015d1d9b11fa862ce7a0 Mon Sep 17 00:00:00 2001 From: Zsolt Viczian Date: Sun, 21 Aug 2022 14:37:07 +0200 Subject: [PATCH] 0.1.8 (Downgrade to React 17) --- manifest.json | 2 +- src/Scene.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 9508eba..8363e22 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "excalibrain", "name": "ExcaliBrain", - "version": "0.1.8", + "version": "0.1.9", "minAppVersion": "0.15.6", "description": "A clean, intuitive and editable graph view for Obsidian", "author": "Zsolt Viczian", diff --git a/src/Scene.ts b/src/Scene.ts index 7bf36d6..026d1fb 100644 --- a/src/Scene.ts +++ b/src/Scene.ts @@ -53,6 +53,7 @@ export class Scene { public async initialize(focusSearchAfterInitiation: boolean) { this.focusSearchAfterInitiation = focusSearchAfterInitiation; await this.plugin.loadSettings(); + if(!this.leaf?.view) return; this.toolsPanel = new ToolsPanel((this.leaf.view as TextFileView).contentEl,this.plugin); this.initializeScene(); } @@ -270,6 +271,10 @@ export class Scene { new Notice("ExcaliBrain On"); } + frame1(); + frame2(); + frame3(); + /**REACT 18 ea.targetView.ownerWindow.requestAnimationFrame(()=>{ frame1(); ea.targetView.ownerWindow.requestAnimationFrame(()=>{ @@ -279,6 +284,7 @@ export class Scene { }); }); }); + */ } addNodes(x:{ @@ -543,12 +549,17 @@ export class Scene { elements: linkElements.concat(nodeElements) //send link elements behind node elements }) + ea.getExcalidrawAPI().updateScene({appState: {viewBackgroundColor: this.plugin.settings.backgroundColor}}); + ea.getExcalidrawAPI().zoomToFit(null,5,0.15); + + /**REACT 18 ea.targetView.ownerWindow.requestAnimationFrame(()=>{ ea.getExcalidrawAPI().updateScene({appState: {viewBackgroundColor: this.plugin.settings.backgroundColor}}); ea.targetView.ownerWindow.requestAnimationFrame(()=>{ ea.getExcalidrawAPI().zoomToFit(null,5,0.15); }); }); + */ this.toolsPanel.rerender(); if(this.focusSearchAfterInitiation) {