mirror of
https://github.com/foss42/apidash.git
synced 2025-12-04 11:57:39 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requestModel != null &&
|
RequestModel executionRequestModel = requestModel!;
|
||||||
!requestModel.preRequestScript.isNullOrEmpty()) {
|
|
||||||
requestModel = await handlePreRequestScript(
|
if (!requestModel.preRequestScript.isNullOrEmpty()) {
|
||||||
|
executionRequestModel = await handlePreRequestScript(
|
||||||
requestModel,
|
requestModel,
|
||||||
originalEnvironmentModel,
|
originalEnvironmentModel,
|
||||||
(envModel, updatedValues) {
|
(envModel, updatedValues) {
|
||||||
@@ -298,9 +299,9 @@ class CollectionStateNotifier
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
APIType apiType = requestModel!.apiType;
|
APIType apiType = executionRequestModel.apiType;
|
||||||
HttpRequestModel substitutedHttpRequestModel =
|
HttpRequestModel substitutedHttpRequestModel =
|
||||||
getSubstitutedHttpRequestModel(requestModel.httpRequestModel!);
|
getSubstitutedHttpRequestModel(executionRequestModel.httpRequestModel!);
|
||||||
|
|
||||||
// set current model's isWorking to true and update state
|
// set current model's isWorking to true and update state
|
||||||
var map = {...state!};
|
var map = {...state!};
|
||||||
|
|||||||
Reference in New Issue
Block a user