summaryrefslogtreecommitdiff
path: root/source/helpers
diff options
context:
space:
mode:
authorGravatar Federico Brigante <me@fregante.com> 2023-05-14 17:32:41 +0800
committerGravatar GitHub <noreply@github.com> 2023-05-14 17:32:41 +0800
commit1d20bb515a8482a0f9b973bc8506f8a8e2bc9f98 (patch)
tree88bc84cc9d1e5c8afe649475dc17bef9e5f2110f /source/helpers
parent22e2209298eecf7deb8933655a3c7dc1777faa01 (diff)
downloadrefined-github-1d20bb515a8482a0f9b973bc8506f8a8e2bc9f98.tar.gz
refined-github-1d20bb515a8482a0f9b973bc8506f8a8e2bc9f98.tar.zst
refined-github-1d20bb515a8482a0f9b973bc8506f8a8e2bc9f98.zip
Fix `open-all-notifications` error display (#6623)
Diffstat (limited to 'source/helpers')
-rw-r--r--source/helpers/open-tabs.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/helpers/open-tabs.ts b/source/helpers/open-tabs.ts
index 86b44884..78619cdf 100644
--- a/source/helpers/open-tabs.ts
+++ b/source/helpers/open-tabs.ts
@@ -1,11 +1,19 @@
+import showToast from '../github-helpers/toast.js';
+import pluralize from '../helpers/pluralize.js';
+
export default async function openTabs(urls: string[]): Promise<boolean> {
if (urls.length >= 10 && !confirm(`This will open ${urls.length} new tabs. Continue?`)) {
return false;
}
- await browser.runtime.sendMessage({
+ const response = browser.runtime.sendMessage({
openUrls: urls,
});
+ await showToast(response, {
+ message: 'Opening…',
+ doneMessage: pluralize(urls.length, '$$ tab') + ' opened',
+ });
+
return true;
}