Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ensure device info is handled despite setTime() awaits #65

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

bobrippling
Copy link
Contributor

This fixes a bug in #64 where, if the time was set, device info would be skipped:

// if the time is obviously wrong, set it up!
console.log("Current device time is "+new Date(info.currentTime));
if (info.currentTime < new Date("2000").getTime()) {
console.log("Time is not set - updating it.");
return Comms.setTime();
}
if (SETTINGS["settime"] && Math.abs(Date.now()-info.currentTime)>2000) {
console.log("SETTINGS.settime=true and >2 seconds out - updating time");
return Comms.setTime();
}
// Show device info in more page:
const deviceInfoElem = document.getElementById("more-deviceinfo");
if (deviceInfoElem) {
deviceInfoElem.style.display = "inherit";
let storageRow = "";

@gfwilliams
Copy link
Member

Thanks for tracking this down and getting a fix in!

@gfwilliams gfwilliams merged commit 4f07b72 into espruino:master Aug 15, 2024
1 check passed
@bobrippling
Copy link
Contributor Author

My pleasure :)

@bobrippling bobrippling deleted the fix-deviceinfo branch August 15, 2024 11:16
@atjn
Copy link
Contributor

atjn commented Aug 16, 2024

Good catch thanks :) I think this was a bug before #64 as well.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants