Add update hook

This commit is contained in:
Samuel Elliott 2018-02-12 17:54:40 +00:00
parent 26fbac6bbc
commit 7e2fca9059
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
2 changed files with 8 additions and 2 deletions

View File

@ -60,8 +60,8 @@
{
"id": "hide-button",
"type": "bool",
"text": "Hide the BetterDiscord menu button",
"hint": "When this is enabled you can use Control/Command + B to open the BetterDiscord menu",
"text": "Hide the BetterDiscord button",
"hint": "When this is enabled you can use Ctrl/Cmd + B to open the BetterDiscord settings menu.",
"value": false,
"disabled": false
}

View File

@ -86,8 +86,10 @@ export default class {
for (let setting of category.settings) {
if (setting.id !== setting_id) continue;
if (setting.value === value) return true;
setting.value = value;
this.settingUpdated(set_id, category_id, setting_id, value);
return true;
}
}
@ -96,6 +98,10 @@ export default class {
return false;
}
static settingUpdated(set_id, category_id, setting_id, value) {
Logger.log('Settings', `${set_id}/${category_id}/${setting_id} was set to ${value}`);
}
static get getSettings() {
return this.settings ? this.settings : defaultSettings;
}