mirror of
https://github.com/Ximi1970/systray-x.git
synced 2025-11-01 19:05:48 +01:00
WIP filters
This commit is contained in:
@@ -411,12 +411,15 @@ async function start() {
|
|||||||
// Get all accounts
|
// Get all accounts
|
||||||
SysTrayX.Messaging.accounts = await browser.accounts.list();
|
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
|
// Get the extended filters
|
||||||
SysTrayX.Messaging.filtersExt = await getFiltersExt();
|
SysTrayX.Messaging.filtersExt = await getFiltersExt();
|
||||||
|
|
||||||
// Get the filters
|
|
||||||
SysTrayX.Messaging.filters = await getFilters();
|
|
||||||
|
|
||||||
// Get the count type
|
// Get the count type
|
||||||
SysTrayX.Messaging.countType = await getCountType();
|
SysTrayX.Messaging.countType = await getCountType();
|
||||||
|
|
||||||
|
|||||||
@@ -89,11 +89,23 @@ async function getMinimizeOnClose() {
|
|||||||
//
|
//
|
||||||
async function getFilters() {
|
async function getFilters() {
|
||||||
function getFiltersCb(result) {
|
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() {
|
function onFiltersError() {
|
||||||
return undefined;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFilters = browser.storage.sync.get("filters");
|
const getFilters = browser.storage.sync.get("filters");
|
||||||
@@ -105,7 +117,13 @@ async function getFilters() {
|
|||||||
//
|
//
|
||||||
async function getFiltersExt() {
|
async function getFiltersExt() {
|
||||||
function getFiltersExtCb(result) {
|
function getFiltersExtCb(result) {
|
||||||
return result.filtersExt || undefined;
|
const filtersExt = result.filtersExt || undefined;
|
||||||
|
console.debug("Accounts: " + SysTrayX.Messaging.accounts);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return filtersExt;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFiltersExtError() {
|
function onFiltersExtError() {
|
||||||
|
|||||||
Reference in New Issue
Block a user