Merge pull request #123 from samuelthomas2774/add-core-settings-storage

Fixed setting loading
This commit is contained in:
Alexei Stukov 2018-02-12 22:12:06 +02:00 committed by GitHub
commit 663af3ca83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -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) {