mirror of
https://github.com/XFox111/TabsAsideExtension.git
synced 2026-04-22 07:58:01 +03:00
fix: partial save notification doesn't appear on firefox
This commit is contained in:
@@ -35,10 +35,10 @@ async function createCollectionFromTabs(tabs: Tabs.Tab[]): Promise<[CollectionIt
|
||||
const tabCount: number = tabs.length;
|
||||
|
||||
tabs = tabs.filter(i =>
|
||||
i.url &&
|
||||
!i.url.startsWith(browser.runtime.getURL("/")) &&
|
||||
new URL(i.url).protocol !== "about:" &&
|
||||
new URL(i.url).hostname !== "newtab"
|
||||
i.url
|
||||
&& !i.url.startsWith(browser.runtime.getURL("/"))
|
||||
&& new URL(i.url).protocol !== "about:"
|
||||
&& new URL(i.url).hostname !== "newtab"
|
||||
);
|
||||
|
||||
const collection: CollectionItem = {
|
||||
@@ -49,6 +49,13 @@ async function createCollectionFromTabs(tabs: Tabs.Tab[]): Promise<[CollectionIt
|
||||
|
||||
let tabIndex: number = 0;
|
||||
|
||||
if (tabs.length < tabCount)
|
||||
await sendNotification({
|
||||
title: i18n.t("notifications.partial_save.title"),
|
||||
message: i18n.t("notifications.partial_save.message"),
|
||||
icon: "/notification_icons/save_warning.png"
|
||||
});
|
||||
|
||||
if (tabs[tabIndex].pinned)
|
||||
{
|
||||
collection.items.push({ type: "group", pinned: true, items: [] });
|
||||
@@ -123,12 +130,5 @@ async function createCollectionFromTabs(tabs: Tabs.Tab[]): Promise<[CollectionIt
|
||||
});
|
||||
}
|
||||
|
||||
if (tabs.length < tabCount)
|
||||
await sendNotification({
|
||||
title: i18n.t("notifications.partial_save.title"),
|
||||
message: i18n.t("notifications.partial_save.message"),
|
||||
icon: "/notification_icons/save_warning.png"
|
||||
});
|
||||
|
||||
return [collection, tabs];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user