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

Improvements to the stopwatch clockinfo #2695

Merged
merged 7 commits into from Apr 17, 2023

Conversation

bobrippling
Copy link
Collaborator

@bobrippling bobrippling commented Apr 16, 2023

Several improvements to the stopwatch clockinfo, inspired by #2692 and #2686:

  • Format option added, to reduce space used (see forum thread on various clocks)
  • Reduced interval to 1s, no point redrawing the same thing 10x per second
  • Don't queue the redraw when shown, if we're paused
    • This was a large drain on the battery, shown in the powermanager app (this.emit(...))

@gfwilliams
Copy link
Member

gfwilliams commented Apr 17, 2023

Thanks! Just to check, are you sure the settings page works ok after being loaded from the app loader?

apps/clkinfostopw/settings.js should really not have "use strict" in it, since the code is passed through an eval(...) statement in order to load the menu (it's not a separate app)

@bobrippling
Copy link
Collaborator Author

Yeah, it did work with "use strict", but I can drop it if you like?
A few other generated files have it (widChargingStatus, widbtstates, btadv), I can drop it from those too? (via a tsconfig change)

@gfwilliams
Copy link
Member

Thanks! Yes, for Espruino the "use strict" has no effect - in apps it's not a big deal (but not adding it in the first place is good). However in the case of the settings file since it's effectively an expression that should be evaluated, having it really isn't great at all - the sanity checker should really have a check in there for stuff like that.

@gfwilliams gfwilliams merged commit 9cb21ce into espruino:master Apr 17, 2023
1 check passed
@bobrippling bobrippling deleted the stopw-improvements branch April 17, 2023 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants