fix: return to sensors list after cancelling reposition only if you've arrived from there

This commit is contained in:
2026-05-18 19:27:08 +02:00
parent 74aeb3589b
commit c54631bcb6
3 changed files with 13 additions and 2 deletions
@@ -77,7 +77,10 @@ class _SensorDetailSheetState extends ConsumerState<SensorDetailSheet> {
void _placeOnFloorPlan(BuildContext context, Sensor sensor) {
final router = GoRouter.of(context);
final fromSensors =
router.routeInformationProvider.value.uri.path == '/sensors';
ref.read(sensorPlacementProvider.notifier).state = sensor;
ref.read(sensorPlacementOriginSensorsProvider.notifier).state = fromSensors;
Navigator.of(context, rootNavigator: true).pop();
router.go('/floorplan');
}