betaflight / blackbox-log-viewer

Interactive log viewer for flight logs recorded with blackbox
GNU General Public License v3.0
448 stars 146 forks source link

Code refactoring in main.js #754

Closed demvlad closed 4 months ago

demvlad commented 4 months ago

Some code refactoring in main.js. Removed duplicated function call in main.js. The let is change to const when it was need.

netlify[bot] commented 4 months ago

Deploy Preview for origin-blackbox-logviewer ready!

Name Link
Latest commit efd00948fb372f0b0e2e572de7d9d5c4487ddad3
Latest deploy log https://app.netlify.com/sites/origin-blackbox-logviewer/deploys/665dee7a421136000860b2cd
Deploy Preview https://deploy-preview-754.dev.blackbox.betaflight.com
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

demvlad commented 4 months ago

It was interst This code works here and does not work in NW.js, because NW.js call (3) and next code below first, and (1), (2) the most lastest. And there are not asinchrone paralell code. I was some confused :)

prefs.get('workspaceGraphConfigs', function(item) { (1) if (item) { workspaceGraphConfigs = upgradeWorkspaceFormat(item); } else { workspaceGraphConfigs = workspaceMenu.getDefaultWorkspace(); } });

    prefs.get('activeWorkspace', function (id){

(2) if (id) { activeWorkspace = id; } else { activeWorkspace = 1; } }); (3) workspaceSelection = new WorkspaceSelection($(".log-workspace-selection"), workspaceGraphConfigs, onSwitchWorkspace, onSaveWorkspace); onSwitchWorkspace(workspaceGraphConfigs, activeWorkspace);