mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-13 23:02:22 +00:00
Let a newer share switch off a library layer still switching on
A share restore skipped every entry whose settled state already matched the share, but a layer still switching on for an earlier share reads as off until it settles. Opening a second share in that window left the first share's layer to come on anyway. The restore now compares with the manager's effective visibility (the newest request), so the newer share supersedes the earlier one.
This commit is contained in:
1 parent
d58ba23fba
commit
0f13c0a1c2
2 files changed
+35
-1
No files matched your search
@@ -204,7 +204,12 @@ export function createDataLibrary({
|
||||
if (wanted && !register(entry)) continue;
|
||||
if (!isRegistered(id)) continue;
|
||||
const layerId = libraryLayerId(id);
|
||||
if (wanted === (dataManager.isEnabled?.(layerId) === true)) continue;
|
||||
// Compare with the newest request, not settled state: a layer still
|
||||
// switching on for an earlier share must be switched off by this one.
|
||||
const current =
|
||||
dataManager.isEffectivelyEnabled?.(layerId) ??
|
||||
dataManager.isEnabled?.(layerId);
|
||||
if (wanted === (current === true)) continue;
|
||||
dataManager
|
||||
.setEnabled(layerId, wanted, { origin })
|
||||
.catch((error) =>
|
||||
|
||||
Reference in new issue
Block a user