mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-26 06:50:25 +01:00
auto select the first non-system collection on collection remove
This commit is contained in:
1 parent
39415e0f49
commit
697545e73f
28 files changed
+37
-37
No files matched your search
@@ -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;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user