feat: add service area restriction overlay and bump version to 1.0.3+8
This commit is contained in:
@@ -251,7 +251,8 @@ Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||
await TripOverlayPlugin.showOverlay(tripData, autoCloseSeconds: 15);
|
||||
}
|
||||
} else {
|
||||
print("⛔ [Background FCM] Ignoring new order overlay - driver is in active ride ($currentRideStatus)");
|
||||
print(
|
||||
"⛔ [Background FCM] Ignoring new order overlay - driver is in active ride ($currentRideStatus)");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -434,7 +435,8 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
try {
|
||||
// سقف ~30 ثانية: يكفي لأبطأ إقلاع بلا أن يدور للأبد
|
||||
for (int attempt = 0; attempt < 60; attempt++) {
|
||||
final String? savedTrip = await storage.read(key: 'pending_driver_list');
|
||||
final String? savedTrip =
|
||||
await storage.read(key: 'pending_driver_list');
|
||||
if (savedTrip == null || savedTrip.isEmpty) {
|
||||
// لا شيء معلّق بعد — الإشعار قد يكون ما زال يُحفَظ من
|
||||
// getInitialMessage، فنكمل الانتظار قليلاً.
|
||||
@@ -468,11 +470,13 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
}
|
||||
|
||||
// لا نقتحم رحلة نشطة بطلب قديم
|
||||
final String currentRideStatus = box.read(BoxName.rideStatus)?.toString() ?? '';
|
||||
final String currentRideStatus =
|
||||
box.read(BoxName.rideStatus)?.toString() ?? '';
|
||||
if (currentRideStatus == 'Begin' ||
|
||||
currentRideStatus == 'Apply' ||
|
||||
currentRideStatus == 'Arrived') {
|
||||
print('⛔ Active ride ($currentRideStatus) — discarding stale pending order.');
|
||||
print(
|
||||
'⛔ Active ride ($currentRideStatus) — discarding stale pending order.');
|
||||
await storage.delete(key: 'pending_driver_list');
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user