()
| 97 | settings: SyncGraphPluginSettings; |
| 98 | |
| 99 | async onload() { |
| 100 | await this.loadSettings(); |
| 101 | |
| 102 | this.addSettingTab(new SyncGraphSettingTab(this.app, this)); |
| 103 | |
| 104 | this.addCommand({ |
| 105 | id: "sync-graph-settings-to-localgraph", |
| 106 | name: "Sync Graph Settings to Local Graph", |
| 107 | callback: async () => { await this.syncGlobalToLocal() } |
| 108 | }) |
| 109 | |
| 110 | this.app.workspace.on('active-leaf-change', async () => { |
| 111 | if (this.settings.autoSync) { |
| 112 | await this.syncGlobalToLocal(); |
| 113 | } |
| 114 | } |
| 115 | ); |
| 116 | } |
| 117 | |
| 118 | async loadSettings() { |
| 119 | this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); |
nothing calls this directly
no test coverage detected