diff --git a/client/src/structs/settings/settingsset.js b/client/src/structs/settings/settingsset.js index 8d7cbf3f..a40921b1 100644 --- a/client/src/structs/settings/settingsset.js +++ b/client/src/structs/settings/settingsset.js @@ -101,6 +101,17 @@ export default class SettingsSet { return false; } + /** + * Return the first setting that matches the id in any category + */ + findFirst(settingId) { + for (let cat of this.categories) { + const found = cat.settings.find(s => s.id === settingId); + if (found) return found; + } + return null; + } + /** * Returns the first category where calling {function} returns true. * @param {Function} function A function to call to filter categories