-
Notifications
You must be signed in to change notification settings - Fork 560
fix ui state not being consistent with the original request model #862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if (requestModel != null && | ||
!requestModel.preRequestScript.isNullOrEmpty()) { | ||
requestModel = await handlePreRequestScript( | ||
RequestModel executionRequestModel = requestModel!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using assignment instead of creating a proper copy of request model which will be modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the necessary corrections in the latest commit
RequestModel executionRequestModel = requestModel!; | ||
|
||
if (!requestModel.preRequestScript.isNullOrEmpty()) { | ||
executionRequestModel = await handlePreRequestScript( | ||
requestModel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you passing the requestModel
and the new executionRequestModel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the necessary corrections in the latest commit
@@ -59,7 +59,7 @@ class _EditRequestScriptsState extends ConsumerState<EditRequestScripts> { | |||
crossAxisAlignment: CrossAxisAlignment.center, | |||
children: [ | |||
Padding( | |||
padding: kPh8b6, | |||
padding: EdgeInsets.symmetric(vertical: 5, horizontal: 8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
@DenserMeerkat Please review. |
@@ -281,9 +281,10 @@ class CollectionStateNotifier | |||
return; | |||
} | |||
|
|||
if (requestModel != null && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 277
final EnvironmentModel? originalEnvironmentModel =
ref.read(selectedEnvironmentModelProvider);
It should use activeEnvironmentIdStateProvider
from settings_providers.dart
to find the active EnvironmentModel
and not selectedEnvironmentModelProvider
from environment_providers.dart
using selectedEnvironmentModelProvider
adds the variables to the wrong environment.
apidash.mp4
…iginal request model
…odel is returned in pre-request script
When no particular environment is selected the following message will be logged in the console,
|
Default environment is always Global. |
fix.mp4 |
PR Description
Checklist
main
branch before making this PRflutter upgrade
and verify)flutter test
) and all tests are passingAdded/updated tests?
OS on which you have developed and tested the feature?