mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
fix(earthquakes, cyclones): an item that goes takes its double-click follow with it
Removing a followed entity ended the default renderer's follow. A disc gone from the feed, or a storm point gone from the advisory (or a cleared one), now ends it too.
This commit is contained in:
1 parent
def2e1ecca
commit
fbc40ef3b6
6 files changed
+46
-2
No files matched your search
@@ -240,6 +240,7 @@ export function createCyclonesLayer({
|
||||
enabled: () => enabled && !destroyed && selectionOwner === owner,
|
||||
targetFor: (hit) => rendering?.followTargetFor?.(hit) ?? null,
|
||||
});
|
||||
owner.follow = follow;
|
||||
owner.unsubscribe = () => {
|
||||
unsubscribe();
|
||||
follow.destroy();
|
||||
@@ -312,6 +313,7 @@ export function createCyclonesLayer({
|
||||
if (next.unavailable) {
|
||||
// An expired advisory must not remain presented as current hazard context.
|
||||
rendering.clear();
|
||||
selectionOwner?.follow?.stop();
|
||||
snapshot = next;
|
||||
selectedId = null;
|
||||
++navigationGeneration;
|
||||
@@ -331,6 +333,8 @@ export function createCyclonesLayer({
|
||||
return false;
|
||||
snapshot = next;
|
||||
error = null;
|
||||
// A storm point no longer in the advisory takes its follow with it.
|
||||
selectionOwner?.follow?.retain((key) => rendering.drawsFollowKey(key));
|
||||
if (!snapshot.storms.some((storm) => storm.id === selectedId))
|
||||
select(
|
||||
selectionIntent === 'cleared'
|
||||
@@ -348,6 +352,7 @@ export function createCyclonesLayer({
|
||||
error = cause?.message || ADVISORIES_UNAVAILABLE;
|
||||
// Failed acquisition has no bounded last-good age guarantee at this layer.
|
||||
rendering?.clear();
|
||||
selectionOwner?.follow?.stop();
|
||||
snapshot = null;
|
||||
selectedId = null;
|
||||
++navigationGeneration;
|
||||
|
||||
Reference in new issue
Block a user