-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
New bug in bigdclock.app.js #3320
Conversation
The value of "width" was being reset somewhere. So "width" has been renamed to "batteryUsedWidth", which is better anyway.
Thanks! That's interesting - it might be interesting to see what's overwriting Please can you add a changelog entry and bump the version and we can change this? |
Version bump.
Changes in v0.09
Done (I think - git is still confusing to me). No idea as to how to check what might be changing |
Thanks! Looks good! |
Just to add, for debugging, maybe since now you're not using |
It gets set to zero. So no help there :/ |
Actually that is some help :) Maybe check in |
One other way to check would be to do this in the IDE: Object.defineProperty(global, "width", { set: () => { throw new Error("tried to set width"); } }) then watch the console for a log appearing that looks like this:
|
@bobrippling that's really cool. It made me realise we should try and put some of these tips into a page. I've started a Wiki at https://github.com/espruino/BangleApps/wiki/Debugging-Tips - if you have any more magic tricks like this, please could you add them? |
Time served debugging minified webapps! Good idea, I'll add to that if I think of any more. That tip about |
The value of "width" was being reset somewhere, which meant that the battery usage feature wasn't working - it was resetting to "battery empty" whenever the clock updated.
So "width" has been renamed to "batteryUsedWidth", which is better anyway, as it is more descriptive of what the variable does.