Skip to content

Commit

Permalink
refactor: ♻️ Better checking on dvWaitTime
Browse files Browse the repository at this point in the history
Defaults to 3 seconds if !dataview
  • Loading branch information
SkepticMystic committed Aug 18, 2021
1 parent 96aa5f4 commit 210142d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/MatrixView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export default class MatrixView extends ItemView {
this.app.workspace.onLayoutReady(async () => {
setTimeout(
async () => await this.draw(),
this.plugin.settings.dvWaitTime
this.app.plugins.plugins.dataview
? this.app.plugins.plugins.dataview.api
? 1
: this.plugin.settings.dvWaitTime
: 3000
);
});

Expand Down
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ export default class BreadcrumbsPlugin extends Plugin {
async () => {
await initEverything();
},
this.app.plugins.plugins.dataview ? this.settings.dvWaitTime : 3000
this.app.plugins.plugins.dataview
? this.app.plugins.plugins.dataview.api
? 1
: this.settings.dvWaitTime
: 3000
);
});

Expand Down

0 comments on commit 210142d

Please sign in to comment.