MCPcopy Create free account
hub / github.com/Xallt/sync-graph-settings / onload

Method onload

main.ts:99–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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());

Callers

nothing calls this directly

Calls 2

loadSettingsMethod · 0.95
syncGlobalToLocalMethod · 0.95

Tested by

no test coverage detected