-
-
Notifications
You must be signed in to change notification settings - Fork 936
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
Fix VTX status update after saving #3034
Conversation
This comment has been minimized.
This comment has been minimized.
AUTOMERGE: (FAIL)
|
48638ed
to
40bd5f7
Compare
This comment has been minimized.
This comment has been minimized.
src/js/tabs/vtx.js
Outdated
@@ -891,7 +891,7 @@ vtx.initialize = function (callback) { | |||
$("#save_button").html(oldText); | |||
}, 2000); | |||
|
|||
TABS.vtx.initialize(); | |||
setTimeout(() => TABS.vtx.initialize, 3000); // Allow firmware to make relevant changes before initialization |
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.
What about to include it in in the setTimeout for the save button that is just before and increase the timeout of it? At least in this way, you know that the tab will be refreshed at the same time than the button, seems more "solid" for me.
Another solution a little more ellaborated is to use more button messages:
- The button contains "Save". The users pushes it.
- We change the text to "Saving..." and start the save process.
- In this part of code, after all has been saved, we start the initialize with a timeout of 3 seconds.
- After the timeout we change the save to "Saved" with a timeout of 2 seconds.
- After this timeout we change the text to "Save" again.
In this way is clear that we are saving and refreshing. It uses the same two timeout than now but in different order and calling one inside the other, and we only need to add the new "Saving..." message.
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 guess 4 seconds will be enough so making them the same the buttons updates more linear.
40bd5f7
to
3a5a862
Compare
This comment has been minimized.
This comment has been minimized.
11300c7
to
2203d62
Compare
This comment has been minimized.
This comment has been minimized.
2203d62
to
6d3bbea
Compare
This comment has been minimized.
This comment has been minimized.
6d3bbea
to
2a3a83e
Compare
Kudos, SonarCloud Quality Gate passed!
|
Do you want to test this code? Here you have an automated build: |
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.
It's not exactly what I susggested but it's ok.
Curious to see your version as I used your functional design here. |
Fixes: #1671