auto select the first non-system collection on collection remove

This commit is contained in:
Gani Georgiev
2024-10-30 09:06:32 +02:00
parent 39415e0f49
commit 697545e73f
28 changed files with 37 additions and 37 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ export function changeActiveCollectionByIdOrName(collectionIdOrName) {
if (found) {
activeCollection.set(found);
} else if (list.length) {
activeCollection.set(list[0]);
activeCollection.set(list.find((c) => !c.system) || list[0]);
}
return list;
@@ -58,7 +58,7 @@ export function removeCollection(collection) {
activeCollection.update((current) => {
if (current.id === collection.id) {
return list[0];
return list.find((c) => !c.system) || list[0];
}
return current;
});