fix: return to sensors list after cancelling reposition only if you've arrived from there
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user