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
[apps/widbt_notify] fix screen redraw #1817
Conversation
Hi @KungPhoo , I noticed that the new showAlert behavior doesn't play well with the setTimeout. I think I managed to solve this problem, but I would like you to first take a look at the code if you approve. |
Looks ok to me - clocks/etc may still draw over it during those 3 seconds though. You could add a plain Also I see there's a One other thing - because you force a reload, it's going to be frustating if you were using another app. Say you're using the calculator and typing a sum in, the alert goes off and 3 seconds later it reloads back to the clock. Probably not ideal. You could check if |
Thanks, @gfwilliams ! Makes sense. Not sure I'll update it quickly, since I'm using a different widget now. But I would like to understand the problem regarding E.g., const DATAFILE = "myapp.json";
var appData = Object.assign({
lastNotify: 0,
}, require('Storage').readJSON(DATAFILE,true)||{});
const time = getTime();
if(time-appData.lastNotify>30) {
// show notification
...
appData.lastNotify = time;
require('Storage').writeJSON(DATAFILE,appData);
} |
Yes - right now you can't persist anything in RAM when you swap between apps. It's just that the relatively limited RAM available and variable quality of apps means allowing apps to store stuff in RAM all the time could very easily make Bangle.js unstable for everyone |
Closing this for now as no updates (and i'm not sure forcing an app reload is going to be a good improvement for the reasons above). Espruino 2v15 now includes the ability to draw 'overlays' so I think that would end up being the best solution (although maybe we should have a library to reduce code duplication) |
Hi,
I noticed that @KungPhoo opened a PR KungPhoo#3, but I think in a wrong repo.
I cherry-picked his commits on top of the master branch.
This should fix #1810