Update: 2026-06-26 04:31:50
This commit is contained in:
@@ -487,9 +487,11 @@ class RideLifecycleController extends GetxController {
|
|||||||
|
|
||||||
case RideState.searching:
|
case RideState.searching:
|
||||||
if (rideId == 'yet' || rideId.isEmpty) break;
|
if (rideId == 'yet' || rideId.isEmpty) break;
|
||||||
|
// إذا كان WebSocket متصلاً ونشطاً، نعتمد عليه ولا نبول
|
||||||
|
if (mapSocket.isSocketConnected) break;
|
||||||
try {
|
try {
|
||||||
String statusFromServer = await getRideStatus(rideId);
|
final statusResult = await getRideStatus(rideId);
|
||||||
if (statusFromServer == 'Apply' || statusFromServer == 'Applied') {
|
if (statusResult == 'Apply' || statusResult == 'Applied') {
|
||||||
await processRideAcceptance(source: "Polling");
|
await processRideAcceptance(source: "Polling");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -3799,9 +3801,15 @@ class RideLifecycleController extends GetxController {
|
|||||||
final response = await CRUD().get(
|
final response = await CRUD().get(
|
||||||
link: "${AppLink.rideServerSide}/ride/rides/getRideStatus.php",
|
link: "${AppLink.rideServerSide}/ride/rides/getRideStatus.php",
|
||||||
payload: {'id': rideId});
|
payload: {'id': rideId});
|
||||||
Log.print(response);
|
Log.print("📡 getRideStatus raw response: $response");
|
||||||
Log.print('2176');
|
if (response is Map<String, dynamic>) {
|
||||||
return response['data'];
|
final data = response['data'];
|
||||||
|
if (data is String) return data;
|
||||||
|
Log.print("⚠️ getRideStatus: data is not a String, got: ${data.runtimeType}");
|
||||||
|
} else {
|
||||||
|
Log.print("⚠️ getRideStatus: response is not a Map, got: ${response.runtimeType}");
|
||||||
|
}
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleActiveRideOnStartup(dynamic data) {
|
void handleActiveRideOnStartup(dynamic data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user