-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(network-status): Notify users when they're working offline #2109
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/hvvlu7ucu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
However, there is no way I can trigger the event to work offline. Where do I see working offline?
Edit: ok there is something strange. I tried a second time from the Vercel preview link and I saw the banner only on the first page (I was on patients). Moving on the dashboard, the banner was gone. (I was working with the wifi off). During the third attempt, I always saw the alert correctly. Tested on Chrome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality and UI look great. I suggest we'll look into a hook possibility.
@tehkapa |
Ok, got it. On Safari doesn't work. |
On page reload (like a refresh), the offline message is absent. I think we'd like to notify the user about the status if they are working offline at the page load. This will be nice when user is offline, and then refreshes a page. The status bar would 'stay' there to indicate user is still offline. |
@kumikokashii I don't understand this comment... If the user is offline, then the page cannot be refreshed, the browser will show an error when trying to refresh the page. |
No, when a user reloads a page, HR must continue to work (since it is offline first). Here's a gif of the problem. https://jmp.sh/EvkscMx |
@tehkapa Ok, now I see your point... I didn't know that there was an option in the browser to work offline, I was testing this feature by turning the wi-fi off. |
@alessioprestileo That looks like what we are looking for. Thank you 🙂 |
My commits from today should address all the comments 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alessioprestileo Hello! Thank you for the updates. I'm only about 95% that the css style and the test's translation parts are the most optimal, but it's functioning well after a page refresh, and I think it's ready go.
Fixes #1773.
Changes proposed in this pull request: