Skip to content

Commit

Permalink
fix: Work around failing unified folders (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
kewisch committed Jan 9, 2025
1 parent 5dc057e commit cc80df3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "quickmove",
"description": "Quick Folder Move",
"version": "3.0.2",
"version": "3.0.3",
"private": true,
"author": "Philipp Kewisch <[email protected]>",
"license": "MPL-2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"manifest_version": 2,
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "3.0.2",
"version": "3.0.3",
"default_locale": "en",
"author": "Philipp Kewisch",
"browser_specific_settings": {
"gecko": {
"id": "[email protected]",
"strict_min_version": "128.0",
"strict_max_version": "135.*"
"strict_max_version": "136.*"
}
},
"icons": {
Expand Down
18 changes: 12 additions & 6 deletions src/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,24 @@ async function load() {
return folder;
} catch (e) {
// Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1939403
console.error(`Could not get tag folder ${tag.key}:`, e);
console.error(`Could not get tag folder ${tag.key}`);
return null;
}
}))).filter(Boolean);

let unifiedFolderTypes = ["inbox", "drafts", "sent", "trash", "templates", "archives", "junk"];

let unifiedFolders = await Promise.all(unifiedFolderTypes.map(async key => {
let folder = await messenger.folders.getUnifiedFolder(key);
folder.subFolders = [];
return folder;
}));
let unifiedFolders = (await Promise.all(unifiedFolderTypes.map(async key => {
try {
let folder = await messenger.folders.getUnifiedFolder(key);
folder.subFolders = [];
return folder;
} catch (e) {
// Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1939403
console.error(`Could not get unified folder ${key}`);
return null;
}
}))).filter(Boolean);

let rootNode = new RootNode({ accounts, skipArchive, tagFolders, unifiedFolders });

Expand Down

0 comments on commit cc80df3

Please sign in to comment.