Revert unnecessary changes

This commit is contained in:
Ashita Prasad
2024-12-15 23:41:12 +05:30
parent fbe1fbecdc
commit 26ad73c63b

View File

@ -254,6 +254,7 @@ class CollectionStateNotifier
); );
RequestModel requestModel = state![id]!; RequestModel requestModel = state![id]!;
if (requestModel.httpRequestModel == null) { if (requestModel.httpRequestModel == null) {
return; return;
} }
@ -261,6 +262,7 @@ class CollectionStateNotifier
HttpRequestModel substitutedHttpRequestModel = HttpRequestModel substitutedHttpRequestModel =
getSubstitutedHttpRequestModel(requestModel.httpRequestModel!); getSubstitutedHttpRequestModel(requestModel.httpRequestModel!);
// set current model's isWorking to true and update state
var map = {...state!}; var map = {...state!};
map[id] = requestModel.copyWith( map[id] = requestModel.copyWith(
isWorking: true, isWorking: true,
@ -311,6 +313,7 @@ class CollectionStateNotifier
ref.read(historyMetaStateNotifier.notifier).addHistoryRequest(model); ref.read(historyMetaStateNotifier.notifier).addHistoryRequest(model);
} }
// update state with response data
map = {...state!}; map = {...state!};
map[id] = newRequestModel; map[id] = newRequestModel;
state = map; state = map;