mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-13 23:02:22 +00:00
Keep a Data Library entry whose layer fails to tear down
Remove dropped an entry from the selection and reported success even when the manager could not disable or destroy its layer, leaving a registered, possibly visible layer that Browse, share links and saved state no longer knew. Remove now keeps the entry and reports failure, so its row and Remove all still reach it and a later Remove can retry.
This commit is contained in:
1 parent
f33a6ada52
commit
53f0a32a1b
2 files changed
+48
-2
No files matched your search
@@ -325,8 +325,13 @@ export function createDataLibrary({
|
||||
async function remove(id) {
|
||||
if (destroyed || pending.has(id)) return false;
|
||||
const work = (async () => {
|
||||
if (isRegistered(id))
|
||||
await dataManager.unregisterLibraryLayer(libraryLayerId(id));
|
||||
// A layer that would not tear down is still there: keep it in the
|
||||
// library so its row, Remove and Remove all still reach it.
|
||||
if (
|
||||
isRegistered(id) &&
|
||||
!(await dataManager.unregisterLibraryLayer(libraryLayerId(id)))
|
||||
)
|
||||
return false;
|
||||
selection = {
|
||||
added: selection.added.filter((other) => other !== id),
|
||||
on: selection.on.filter((other) => other !== id),
|
||||
|
||||
Reference in new issue
Block a user