File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -468,7 +468,18 @@ async def on_minor_map(event: MinorMapEvent) -> None:
468468
469469 unsubscribers .append (self ._event_bus .subscribe (MinorMapEvent , on_minor_map ))
470470
471- self ._event_bus .request_refresh (CachedMapInfoEvent )
471+ async def on_cached_info (_ : CachedMapInfoEvent ) -> None :
472+ # We need to subscribe to it, otherwise it could happen
473+ # that the required MapSet Events are not get
474+ pass
475+
476+ cached_map_subscribers = self ._event_bus .has_subscribers (CachedMapInfoEvent )
477+ unsubscribers .append (
478+ self ._event_bus .subscribe (CachedMapInfoEvent , on_cached_info )
479+ )
480+ if cached_map_subscribers :
481+ # Request update only if there was already a subscriber before
482+ self ._event_bus .request_refresh (CachedMapInfoEvent )
472483
473484 async def on_position (event : PositionsEvent ) -> None :
474485 self ._map_data .positions = event .positions
You can’t perform that action at this time.
0 commit comments