Attempt to implement settings syncing
This commit is contained in:
parent
b53b8758ba
commit
9824d2ba31
10 changed files with 118 additions and 10 deletions
26
settings.ts
26
settings.ts
|
|
@ -26,5 +26,31 @@ export class ExampleSettingsTab extends PluginSettingTab {
|
|||
await this.plugin.saveSettings();
|
||||
})
|
||||
);
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Habitica User ID")
|
||||
.setDesc("Can be found in Settings > API")
|
||||
.addText((text) =>
|
||||
text
|
||||
.setPlaceholder("User ID")
|
||||
.setValue(this.plugin.settings.userID)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.userID = value;
|
||||
await this.plugin.saveSettings();
|
||||
})
|
||||
);
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Habitica API Token")
|
||||
.setDesc("Can be found in Settings > API")
|
||||
.addText((text) =>
|
||||
text
|
||||
.setPlaceholder("API Token")
|
||||
.setValue(this.plugin.settings.apiToken)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.apiToken = value;
|
||||
await this.plugin.saveSettings();
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue