Skip to content

Commit d5d60da

Browse files
committed
fix: router enum
1 parent 94d92f1 commit d5d60da

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/app/home/page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
892892
return BlurredIconButton(
893893
icon: const Icon(Symbols.map_rounded),
894894
tooltip: '地圖',
895-
onPressed: () => MapRoute(layers: layers.join(',')).push(context),
895+
onPressed: () => MapRoute(layers: layers.map((l) => l.name).join(',')).push(context),
896896
elevation: 2,
897897
);
898898
},

lib/app/map/page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class MapPageOptions {
5050
final replay = queryParameters['replay'];
5151

5252
return MapPageOptions(
53-
initialLayers: layers?.map((layer) => MapLayer.values.byName(layer)).toSet(),
53+
initialLayers: layers?.map((layer) => MapLayer.values.asNameMap()[layer]).whereType<MapLayer>().toSet(),
5454
reportId: report,
5555
replayTimestamp: replay == null ? null : int.tryParse(replay),
5656
);

0 commit comments

Comments
 (0)