mirror of
https://github.com/foss42/apidash.git
synced 2025-12-03 11:27:50 +08:00
fix: keep ui state consistent with the original request model when scripts are run
This commit is contained in:
@@ -281,9 +281,10 @@ class CollectionStateNotifier
|
||||
return;
|
||||
}
|
||||
|
||||
if (requestModel != null &&
|
||||
!requestModel.preRequestScript.isNullOrEmpty()) {
|
||||
requestModel = await handlePreRequestScript(
|
||||
RequestModel executionRequestModel = requestModel!;
|
||||
|
||||
if (!requestModel.preRequestScript.isNullOrEmpty()) {
|
||||
executionRequestModel = await handlePreRequestScript(
|
||||
requestModel,
|
||||
originalEnvironmentModel,
|
||||
(envModel, updatedValues) {
|
||||
@@ -298,9 +299,9 @@ class CollectionStateNotifier
|
||||
);
|
||||
}
|
||||
|
||||
APIType apiType = requestModel!.apiType;
|
||||
APIType apiType = executionRequestModel.apiType;
|
||||
HttpRequestModel substitutedHttpRequestModel =
|
||||
getSubstitutedHttpRequestModel(requestModel.httpRequestModel!);
|
||||
getSubstitutedHttpRequestModel(executionRequestModel.httpRequestModel!);
|
||||
|
||||
// set current model's isWorking to true and update state
|
||||
var map = {...state!};
|
||||
|
||||
Reference in New Issue
Block a user