Merge pull request #123 from samuelthomas2774/add-core-settings-storage
Fixed setting loading
This commit is contained in:
commit
663af3ca83
|
@ -29,7 +29,7 @@ export default class {
|
|||
if (!set) continue;
|
||||
|
||||
for (let newCategory of newSet.settings) {
|
||||
let category = this.settings.find(c => c.category === newCategory.category);
|
||||
let category = set.settings.find(c => c.category === newCategory.category);
|
||||
if (!category) continue;
|
||||
|
||||
for (let newSetting of newCategory.settings) {
|
||||
|
@ -92,10 +92,12 @@ export default class {
|
|||
const category = this.getCategory(set_id, category_id);
|
||||
if (!category) return;
|
||||
|
||||
const setting = category.settings.find(s => s.id === setting_id);
|
||||
if (!setting) return;
|
||||
return category.settings.find(s => s.id === setting_id);
|
||||
}
|
||||
|
||||
return setting.value;
|
||||
static get(set_id, category_id, setting_id) {
|
||||
const setting = this.getSetting(set_id, category_id, setting_id);
|
||||
return setting ? setting.value : undefined;
|
||||
}
|
||||
|
||||
static setSetting(set_id, category_id, setting_id, value) {
|
||||
|
|
Loading…
Reference in New Issue