Skip to content

Commit

Permalink
0.1.8 (Downgrade to React 17)
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Aug 21, 2022
1 parent e5031ed commit 86d8411
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
11 changes: 11 additions & 0 deletions src/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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(()=>{
Expand All @@ -279,6 +284,7 @@ export class Scene {
});
});
});
*/
}

addNodes(x:{
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 86d8411

Please sign in to comment.