Commit graph

13 commits

Author SHA1 Message Date
Bruno Windels 8894329fa3 don't use url to open room as it still refreshes the page on chrome
even though only the hash is different
2021-03-31 16:52:37 +02:00
Bruno Windels 3767060632 fix reloading or opening wrong page when clicking notif 2021-03-31 16:34:37 +02:00
Bruno Windels 07fc49e371 Never close notifs unless clicking them as all browsers only seem to show the last one anyway 2021-03-25 11:13:54 +01:00
Bruno Windels b3680af342 move comment back to right place, and explain we we do it after 2021-03-25 10:23:43 +01:00
Bruno Windels 889ca05506 log when we get a click from a notif without a tag
like when the browser decides to show "site got updated in the
background" notif in response to a unread=0 push message.
2021-03-25 10:11:05 +01:00
Bruno Windels e54a707684 rework notifications
- we don't close them when receiving a push message without event_id
   as we always need to have a notification open after a push message
   and replacing them with a generic one like we did is worse than just
   leaving it open

 - after the second notification for a room, we just show "New messages"
   and you don't get binged again for new messages after that.

 - You will still have a notification for every room, and on Android
   you will just see the one for the last room as it only shows one
   notification at a time.
2021-03-25 10:08:38 +01:00
Bruno Windels f98369c4d6 remove obsolete code from refactoring before 2021-03-25 10:07:42 +01:00
Bruno Windels a70a38f481 focus can throw on Android, wrap it in a try/catch 2021-03-25 10:03:44 +01:00
Bruno Windels bc763e2a19 fix typo 2021-03-25 10:01:25 +01:00
Bruno Windels 165532be30 add badge icon to notifs 2021-03-25 00:12:57 +01:00
Bruno Windels 0b3f2a7fa0 improve notification click handling
- also here don't use client.url to figure out if a session is open
   as that doesn't work in FF
 - use tag to make sure we're dealing with the right type of notif
 - use findClient function
2021-03-24 15:25:59 +01:00
Bruno Windels f91abe4301 improve notifications shown
- use event.waitUntil to prevent default notification
 - replace notifications for same room
 - replace notifications when receiving unread=0 with "Read messages"
   to prevent default notification
 - don't rely on client.url to figure out if a room is open as FF
   does not update this field on hash changes.
2021-03-24 15:23:01 +01:00
Bruno Windels 178790d816 symlink service worker for local dev, so its scope captures whole app
also rename service worker (as it is not a template anymore)
2021-03-23 18:20:23 +01:00
Renamed from src/platform/web/service-worker.template.js (Browse further)