ensure reading from synced settings
This commit is contained in:
parent
c24ba38ff6
commit
dd83ba45fe
1 changed files with 8 additions and 7 deletions
|
@ -51,9 +51,10 @@ export default class filters {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Add every item to the queue based on what was loaded first.
|
// Add every item to the queue based on what was loaded first.
|
||||||
if (await read(`filters`, -1)) {
|
let FILTERS_ALL = await read(["settings", `filters`]);
|
||||||
for (let FILTER_URL_INDEX = 0; FILTER_URL_INDEX < Object.keys(await read(`filters`, -1)).length; FILTER_URL_INDEX++) {
|
if ((typeof (FILTERS_ALL) == `obj` && !Array.isArray(FILTERS_ALL)) ? Object.keys(FILTERS_ALL).length <= 0 : false) {
|
||||||
let FILTER_URL = Object.keys(await read([`settings`, `filters`], 1))[FILTER_URL_INDEX];
|
for (let FILTER_URL_INDEX = 0; FILTER_URL_INDEX < Object.keys(FILTERS_ALL).length; FILTER_URL_INDEX++) {
|
||||||
|
let FILTER_URL = (Object.keys(FILTERS_ALL, 1))[FILTER_URL_INDEX];
|
||||||
if (FILTER_URL.includes(`://`)) {
|
if (FILTER_URL.includes(`://`)) {
|
||||||
filters.enqueue(FILTER_URL);
|
filters.enqueue(FILTER_URL);
|
||||||
}
|
}
|
||||||
|
@ -78,10 +79,10 @@ export default class filters {
|
||||||
write(["filters", filter_URL], result, -1);
|
write(["filters", filter_URL], result, -1);
|
||||||
alerts.log(texts.localized(`settings_filters_update_status_complete`,null,[filter_URL]));
|
alerts.log(texts.localized(`settings_filters_update_status_complete`,null,[filter_URL]));
|
||||||
|
|
||||||
// Add the filter to the sync list.
|
// Add the filter to the sync list.
|
||||||
if ((await read(["settings", `filters`, filter_URL], 1)) == null) {
|
if ((await read(["settings", `filters`])) ? !((Object.keys(await read(["settings", `filters`]))).includes(filter_URL)) : true) {
|
||||||
write(["settings", `filters`, filter_URL], true, 1);
|
write(["settings", `filters`, filter_URL], true, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(async function(error) {
|
.catch(async function(error) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue