Trevor Sullivan
Trevor Sullivan•17mo ago

Remove App Refresh, but leave it enabled

I want my data to periodically refresh in the background, but don't display the distracting UI element that shows that the app refresh is in-progress. Of course, I could use the "Hide Bar" option, but then I can't set my app to auto-refresh on an interval. How can I maintain the refresh interval, while hiding the bar?
No description
18 Replies
rubenf
rubenf•17mo ago
right now you cannot
Sindre
Sindre•17mo ago
You cant use a frontend script with setInterval and reCompute? Have not tried but though that should be possible 🙂 Challenging the master here.., so I'm prop. wrong.
Trevor Sullivan
Trevor SullivanOP•17mo ago
Great idea
Trevor Sullivan
Trevor SullivanOP•17mo ago
@sindresvendby I tried this, but didn't work
No description
Trevor Sullivan
Trevor SullivanOP•17mo ago
It prints out the message on line 1, but setInterval() doesn't seem to be available.
rubenf
rubenf•17mo ago
setInterval should be available but you're using it a bit wrong and yes I didn't think of that @sindresvendby However, I don't recommend doing this like really not because you will never destroy the internval so it will run forever
Trevor Sullivan
Trevor SullivanOP•17mo ago
Oh I'm not passing in a callback .... duh
rubenf
rubenf•17mo ago
yes
Trevor Sullivan
Trevor SullivanOP•17mo ago
I can track the ID of the refresh interval and delete it, if a new one is created
rubenf
rubenf•17mo ago
you do you i'm just warning but just to be clear when i say forever, I mean even if you exit the app
Trevor Sullivan
Trevor SullivanOP•17mo ago
Oh .... that's not good
rubenf
rubenf•17mo ago
you can do things around it like checking that some objects are still available in the internval What's so bad about the bar ? you can style it in css to make it more discrete
Trevor Sullivan
Trevor SullivanOP•17mo ago
I just don't like seeing the activity indicator. It feels less seamless from a UX perspective.
rubenf
rubenf•17mo ago
we can probably add an option to set a default refresh time
Trevor Sullivan
Trevor SullivanOP•17mo ago
@sindresvendby this works ... of course, without considering that clicking the button multiple times will register a bunch of timers ....
No description
Trevor Sullivan
Trevor SullivanOP•17mo ago
Trevor Sullivan
Trevor SullivanOP•17mo ago
Single button to enable / disable auto-refresh 🙂 🚀
No description