Add update hook
This commit is contained in:
parent
26fbac6bbc
commit
7e2fca9059
|
@ -60,8 +60,8 @@
|
||||||
{
|
{
|
||||||
"id": "hide-button",
|
"id": "hide-button",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"text": "Hide the BetterDiscord menu button",
|
"text": "Hide the BetterDiscord button",
|
||||||
"hint": "When this is enabled you can use Control/Command + B to open the BetterDiscord menu",
|
"hint": "When this is enabled you can use Ctrl/Cmd + B to open the BetterDiscord settings menu.",
|
||||||
"value": false,
|
"value": false,
|
||||||
"disabled": false
|
"disabled": false
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,8 +86,10 @@ export default class {
|
||||||
|
|
||||||
for (let setting of category.settings) {
|
for (let setting of category.settings) {
|
||||||
if (setting.id !== setting_id) continue;
|
if (setting.id !== setting_id) continue;
|
||||||
|
if (setting.value === value) return true;
|
||||||
|
|
||||||
setting.value = value;
|
setting.value = value;
|
||||||
|
this.settingUpdated(set_id, category_id, setting_id, value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,6 +98,10 @@ export default class {
|
||||||
return false;
|
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() {
|
static get getSettings() {
|
||||||
return this.settings ? this.settings : defaultSettings;
|
return this.settings ? this.settings : defaultSettings;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue