mirror of
https://github.com/Ximi1970/systray-x.git
synced 2025-11-01 10:55:48 +01:00
WIP filters
This commit is contained in:
@@ -411,12 +411,15 @@ async function start() {
|
||||
// Get all accounts
|
||||
SysTrayX.Messaging.accounts = await browser.accounts.list();
|
||||
|
||||
// Get the filters and convert old filters
|
||||
const converted = await getFilters();
|
||||
if( converted ) {
|
||||
console.log("Filters converted to new format");
|
||||
}
|
||||
|
||||
// Get the extended filters
|
||||
SysTrayX.Messaging.filtersExt = await getFiltersExt();
|
||||
|
||||
// Get the filters
|
||||
SysTrayX.Messaging.filters = await getFilters();
|
||||
|
||||
// Get the count type
|
||||
SysTrayX.Messaging.countType = await getCountType();
|
||||
|
||||
|
||||
@@ -89,11 +89,23 @@ async function getMinimizeOnClose() {
|
||||
//
|
||||
async function getFilters() {
|
||||
function getFiltersCb(result) {
|
||||
return result.filters || undefined;
|
||||
let filters = result.filters || undefined;
|
||||
|
||||
console.debug("Converting filters....")
|
||||
|
||||
|
||||
// Store extended query filters
|
||||
/*
|
||||
browser.storage.sync.set({
|
||||
filtersExt: filters,
|
||||
});
|
||||
*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onFiltersError() {
|
||||
return undefined;
|
||||
return false;
|
||||
}
|
||||
|
||||
const getFilters = browser.storage.sync.get("filters");
|
||||
@@ -105,7 +117,13 @@ async function getFilters() {
|
||||
//
|
||||
async function getFiltersExt() {
|
||||
function getFiltersExtCb(result) {
|
||||
return result.filtersExt || undefined;
|
||||
const filtersExt = result.filtersExt || undefined;
|
||||
console.debug("Accounts: " + SysTrayX.Messaging.accounts);
|
||||
|
||||
|
||||
|
||||
|
||||
return filtersExt;
|
||||
}
|
||||
|
||||
function onFiltersExtError() {
|
||||
|
||||
Reference in New Issue
Block a user