mirror of
https://github.com/XFox111/TabsAsideExtension.git
synced 2026-04-22 07:58:01 +03:00
Added "Restore without removing" feature
This commit is contained in:
+5
-2
@@ -129,7 +129,7 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse)
|
||||
SaveCollection();
|
||||
break;
|
||||
case "restoreTabs":
|
||||
RestoreCollection(message.collectionIndex);
|
||||
RestoreCollection(message.collectionIndex, message.removeCollection);
|
||||
sendResponse();
|
||||
break;
|
||||
case "deleteTabs":
|
||||
@@ -211,7 +211,7 @@ function DeleteCollection(collectionIndex)
|
||||
UpdateTheme();
|
||||
}
|
||||
|
||||
function RestoreCollection(collectionIndex)
|
||||
function RestoreCollection(collectionIndex, removeCollection)
|
||||
{
|
||||
collections[collectionIndex].links.forEach(i =>
|
||||
{
|
||||
@@ -222,6 +222,9 @@ function RestoreCollection(collectionIndex)
|
||||
});
|
||||
});
|
||||
|
||||
if (!removeCollection)
|
||||
return;
|
||||
|
||||
collections = collections.filter(i => i != collections[collectionIndex]);
|
||||
localStorage.setItem("sets", JSON.stringify(collections));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user