Skip to content

Commit

Permalink
fix: only show diff command when sync enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
kometenstaub committed Mar 23, 2024
1 parent 91b9490 commit 5a3bd54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare module 'obsidian' {
plugins: {
sync: {
instance: syncInstance;
enabled: boolean;
};
'file-recovery': {
instance: fileRInstance;
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export default class OpenSyncHistoryPlugin extends Plugin {
new SyncDiffView(this, this.app, file).open();
}


giveCallback(
fn: (file: TFile) => Promise<void> | void
): Command['checkCallback'] {
Expand Down Expand Up @@ -87,7 +86,9 @@ export default class OpenSyncHistoryPlugin extends Plugin {
async onload() {
console.log('loading Version History Diff plugin');

this.addCommand(this.returnDiffCommand());
if (this.app.internalPlugins.plugins.sync.enabled) {
this.addCommand(this.returnDiffCommand());
}
this.addCommand(this.returnRecoveryDiffCommand());
if (this.app.plugins.getPlugin('obsidian-git')) {
this.addCommand(this.returnGitDiffCommand());
Expand Down

0 comments on commit 5a3bd54

Please sign in to comment.