claesbert / PlexampStatusPage

A quick html page to cast to view the status of PlexAmp on your network
Creative Commons Zero v1.0 Universal
6 stars 1 forks source link

(Potential) Fix progress bar not updating and improve state management #9

Closed protobear closed 3 weeks ago

protobear commented 3 weeks ago

Untested as I have yet to set up my own testing environment for testing the application.

I think the progress bar wasn't updating because imported variables in ES6 modules are read-only, so updates in ui.js didn't affect the originals in api.js. There was also a TypeError from trying to assign a new value to a variable declared with const. I hopefully fixed it by creating a shared state object in state.js that both modules import and update, and by removing the const declarations when updating variables in ui.js. The progress bar should update correctly. I also changed the polling rate from 5000 to 1000

claesbert commented 3 weeks ago

The progress bar works again, but makes weird jumps, as if the updating of the internals and the updating of UI are unsynced.