mirror of
https://github.com/Ximi1970/systray-x.git
synced 2026-01-23 23:49:02 +01:00
Fix clean startup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user