Skip to content
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

Merged
merged 1 commit into from Oct 11, 2022

Conversation

haslinghuis
Copy link
Member

Fixes: #1671

@haslinghuis haslinghuis added this to the 10.9.0 milestone Oct 6, 2022
@haslinghuis haslinghuis self-assigned this Oct 6, 2022
@github-actions

This comment has been minimized.

@blckmn
Copy link
Member

blckmn commented Oct 6, 2022

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> FAIL
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> PASS
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> PASS
  • Tested label found -> FAIL
  • assigned to an approver -> PASS
  • approver count at least three -> FAIL

@github-actions

This comment has been minimized.

@@ -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
Copy link
Member

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.

Copy link
Member Author

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.

@github-actions

This comment has been minimized.

@haslinghuis haslinghuis force-pushed the fix-vtx-status branch 3 times, most recently from 11300c7 to 2203d62 Compare October 7, 2022 20:31
@github-actions

This comment has been minimized.

@haslinghuis haslinghuis changed the title Fix VTX status Fix VTX status update after saving Oct 7, 2022
@github-actions

This comment has been minimized.

@sonarcloud
Copy link

sonarcloud bot commented Oct 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2022

Do you want to test this code? Here you have an automated build:
Betaflight-Configurator-Android
Betaflight-Configurator-Linux
Betaflight-Configurator-macOS
Betaflight-Configurator-Windows
WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!

Copy link
Member

@McGiverGim McGiverGim left a 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.

@haslinghuis
Copy link
Member Author

Curious to see your version as I used your functional design here.

@haslinghuis haslinghuis merged commit 1efa126 into betaflight:master Oct 11, 2022
Finalizing Firmware 4.4 Release automation moved this from Configurator to Closed Oct 11, 2022
@haslinghuis haslinghuis deleted the fix-vtx-status branch October 11, 2022 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Video Transmitter tab not displaying pit mode status after a change
5 participants