From cc80df3429453220c8649aa121fcb6e51b688bce Mon Sep 17 00:00:00 2001 From: Philipp Kewisch Date: Thu, 9 Jan 2025 22:25:32 +0100 Subject: [PATCH] fix: Work around failing unified folders (#194) --- package-lock.json | 2 +- package.json | 2 +- src/manifest.json | 4 ++-- src/popup/popup.js | 18 ++++++++++++------ 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4864f7d..43f015f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "quickmove", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index d4147b1..8e612db 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "quickmove", "description": "Quick Folder Move", - "version": "3.0.2", + "version": "3.0.3", "private": true, "author": "Philipp Kewisch ", "license": "MPL-2.0", diff --git a/src/manifest.json b/src/manifest.json index 94041b3..cf0430b 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -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": "quickmove@mozilla.kewis.ch", "strict_min_version": "128.0", - "strict_max_version": "135.*" + "strict_max_version": "136.*" } }, "icons": { diff --git a/src/popup/popup.js b/src/popup/popup.js index b6d6dab..59c5f26 100644 --- a/src/popup/popup.js +++ b/src/popup/popup.js @@ -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 });