diff --git a/webext/js/defaults.js b/webext/js/defaults.js index ce78a71..a047f6d 100644 --- a/webext/js/defaults.js +++ b/webext/js/defaults.js @@ -98,7 +98,11 @@ function checkFilters(filters) { const inbox = account.folders.filter((folder) => folder.type == "inbox"); if (inbox.length > 0) { - let folder = { ...inbox[0], accountName: account.name }; + let folder = { + ...inbox[0], + accountName: account.name, + path: "/" + inbox[0].name, + }; delete folder.type; delete folder.subFolders; @@ -254,8 +258,12 @@ async function getFilters() { function getFiltersCb(result) { const filters = result.filters || undefined; + console.debug("Stored fiilters: " + JSON.stringify(filters)); + const newFilters = checkFilters(filters); + console.debug("Checked fiilters: " + JSON.stringify(newFilters)); + return newFilters; } diff --git a/webext/options.js b/webext/options.js index 86498fc..5806530 100644 --- a/webext/options.js +++ b/webext/options.js @@ -444,9 +444,17 @@ SysTrayX.RestoreOptions = { ); if (inbox.length > 0) { + let folder = { + ...inbox[0], + accountName: account.name, + path: "/" + inbox[0].name, + }; + delete folder.type; + delete folder.subFolders; + filters.push({ unread: true, - folder: inbox[0], + folder: folder, }); } });