Skip to content

Commit

Permalink
0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Jul 9, 2022
1 parent e01cf7b commit 34ad02d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "excalibrain",
"name": "ExcaliBrain",
"version": "0.1.3",
"minAppVersion": "0.15.3",
"version": "0.1.4",
"minAppVersion": "0.15.5",
"description": "A clean, intuitive and editable graph view for Obsidian",
"author": "Zsolt Viczian",
"authorUrl": "https://zsolt.blog",
Expand Down
4 changes: 2 additions & 2 deletions src/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class Scene {
* @param path
* @returns
*/
public async renderGraphForPath(path: string) {
public async renderGraphForPath(path: string, openFile:boolean = true) {
if(!this.isActive()) {
return;
}
Expand Down Expand Up @@ -132,7 +132,7 @@ export class Scene {
return; //don't reload the file if it has not changed
}

if(isFile) {
if(isFile && openFile) {
//@ts-ignore
if(!this.centralLeaf || !app.workspace.getLeafById(this.centralLeaf.id)) {
this.centralLeaf = this.ea.openFileInNewOrAdjacentLeaf(page.file);
Expand Down
12 changes: 11 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ export default class ExcaliBrain extends Plugin {
return false;
}
}
this.scene?.renderGraphForPath(path);
//had to add this, because the leaf that opens the file does not get focus, thus the on leaf change
//event handler does not run
this.scene?.renderGraphForPath(path,false);
return true;
}
this.scene?.renderGraphForPath(path);
Expand Down Expand Up @@ -713,6 +715,14 @@ export default class ExcaliBrain extends Plugin {
if(!leaf.view) {
return;
}
if(!(leaf.view instanceof TextFileView)) {
new Notice("Wrong view type. Cannot start ExcaliBrain.");
return;
}
if(leaf.view.file.path !== this.settings.excalibrainFilepath) {
new Notice(`The brain file is not the one configured in settings!\nThe file in settings is ${this.settings.excalibrainFilepath}.\nThis file is ${leaf.view.file.path}.\nPlease start ExcaliBrain using the Command Palette action.`,5000);
return;
}
let counter = 0;
while(!this.pluginLoaded && counter++<100) await sleep(50);
if(!this.pluginLoaded) {
Expand Down
1 change: 1 addition & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"0.1.4": "0.15.5",
"0.1.3": "0.15.3",
"0.1.0": "0.15.2",
"0.0.22": "0.14.0"
Expand Down

0 comments on commit 34ad02d

Please sign in to comment.