fix : new ui changes
This commit is contained in:
@@ -128,6 +128,12 @@ class DioRemote implements IHttpClient {
|
||||
options: Options(headers: headers),
|
||||
cancelToken: ApiHandler.globalCancelToken,
|
||||
);
|
||||
if (fromJson != null) {
|
||||
final rawData = response.data;
|
||||
final parsedData = rawData is Map<String, dynamic> ? fromJson(rawData) : null;
|
||||
response.data = parsedData;
|
||||
return DioResponse<T>(response);
|
||||
}
|
||||
return DioResponse<T>(response);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ Future<T?> gSafeCall<T>({
|
||||
} catch (error, stackTrace) {
|
||||
retryCount++;
|
||||
|
||||
eLog('Error in gSafeCall: $error, retryCount: $retryCount , stackTrace : $stackTrace ');
|
||||
|
||||
if (error is DioException && error.response?.statusCode == 401) {
|
||||
if (showError) {
|
||||
@@ -79,7 +80,7 @@ Future<T?> gSafeCall<T>({
|
||||
return null;
|
||||
}
|
||||
|
||||
// صبر قبل از retry
|
||||
|
||||
if (retryCount <= maxRetries) {
|
||||
await Future.delayed(retryDelay);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user