Skip to content

Commit

Permalink
fix: Unloading problem if unloaded too quickly
Browse files Browse the repository at this point in the history
  • Loading branch information
HEmile committed Jan 15, 2022
1 parent 9a9db3a commit 3f2b1b1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 109 deletions.
58 changes: 5 additions & 53 deletions main.js

Large diffs are not rendered by default.

54 changes: 0 additions & 54 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,48 +90,6 @@ export default class JugglPlugin extends Plugin implements IJugglPlugin {
this.settings.graphSettings = Object.assign({}, DefaultJugglSettings.graphSettings, this.settings.graphSettings);
this.settings.embedSettings = Object.assign({}, DefaultJugglSettings.embedSettings, this.settings.embedSettings);

// this.statusBar = this.addStatusBarItem();
// this.statusBar.setText(STATUS_OFFLINE);
// this.neo4jStream = new Neo4jStream(this);
// this.addChild(this.neo4jStream);

// this.registerView(NV_VIEW_TYPE, (leaf: WorkspaceLeaf) => this.neovisView=new NeoVisView(leaf, this.app.workspace.activeLeaf?.getDisplayText(), this))

// this.addCommand({
// id: 'restart-stream',
// name: 'Restart Neo4j stream',
// callback: () => {
// console.log('Restarting stream');
// this.neo4jStream.restart();
// },
// });
// this.addCommand({
// id: 'stop-stream',
// name: 'Stop Neo4j stream',
// callback: () => {
// this.neo4jStream.shutdown();
// },
// });

// this.addCommand({
// id: 'open-bloom-link',
// name: 'Open note in Neo4j Bloom',
// callback: () => {
// if (!this.stream_process) {
// new Notice("Cannot open in Neo4j Bloom as neo4j stream is not active.")
// }
// let active_view = this.app.workspace.getActiveViewOfType(MarkdownView);
// if (active_view == null) {
// return;
// }
// let name = active_view.getDisplayText();
// // active_view.getState().
//
// console.log(encodeURI("neo4j://graphapps/neo4j-bloom?search=SMD_no_tags with name " + name));
// open(encodeURI("neo4j://graphapps/neo4j-bloom?search=SMD_no_tags with name " + name));
// // require("electron").shell.openExternal("www.google.com");
// },
// });

this.addCommand({
id: 'open-vis',
Expand All @@ -150,18 +108,6 @@ export default class JugglPlugin extends Plugin implements IJugglPlugin {
},
});

// this.addCommand({
// id: 'execute-query',
// name: 'Execute Cypher query',
// callback: () => {
// if (!this.neo4jStream) {
// new Notice('Cannot open local graph as neo4j stream is not active.');
// return;
// }
// this.executeQuery();
// },
// });

this.addSettingTab(new JugglGraphSettingsTab(this.app, this));

this.registerEvent(this.app.workspace.on('file-menu', (menu, file: TFile) => {
Expand Down
3 changes: 2 additions & 1 deletion src/viz/visualization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export class Juggl extends Component implements IJuggl {
});
}


this.viz.dblclick();

if (this.settings.navigator) {
Expand Down Expand Up @@ -174,7 +175,6 @@ export class Juggl extends Component implements IJuggl {
this.restartLayout();
}

console.log('Visualization ready');

const view = this;
this.viz.on('tap boxselect', async (e) => {
Expand Down Expand Up @@ -305,6 +305,7 @@ export class Juggl extends Component implements IJuggl {
}, DEBOUNCE_FOLLOW, true));
this.vizReady = true;
this.trigger('vizReady', this.viz);
console.log('Visualization ready');
}

async popover(mdContent: string, sourcePath: string, target: Singular, styleClass: string) {
Expand Down
4 changes: 3 additions & 1 deletion src/viz/workspaces/workspace-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ export class WorkspaceMode extends Component implements IAGMode {
if (this.toolbar) {
this.toolbar.$destroy();
}
this.menu.destroy();
if (this.menu) {
this.menu.destroy();
}
}

getName(): string {
Expand Down

0 comments on commit 3f2b1b1

Please sign in to comment.