askvortsov1/flarum-pwa

Add Auto Refresh When Open

Opened this issue · 1 comments

Sometimes when IO open the PWA there it is not refreshed and is stale. For example I know someone posted but when I click the PWA icon on my android for an open the app, I won't see the new post until I pull down to refresh.

If there was a way to force a refresh on open that would be great!

From what I've seen when searching about this, opening the PWA is viewed similarly to opening a browser tab. Maybe a test of window.onfocus iff in PWA mode should trigger a refresh? I'll need to test this to make sure it's not refreshing unnecessarily.

Maybe there should also be a time threshold?