Code works but it prints a warning in the console:
> Warning: Invalid DOM property `autocomplete`. Did you mean `autoComplete`?
Co-authored-by: ekzyis <ek@stacker.news>
* Only close notifications manually on iOS
* Use function instead of hardcoded string
---------
Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
* refactor: Use log function in service worker
* Add verbose logging on push listener
* Fix TypeError: Cannot read properties of null (reading 'postMessage')
navigator.serviceWorker.controller is null on forced refreshes:
"""
This property returns null if the request is a force refresh (Shift + refresh) or if there is no active worker.
"""
-- https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/controller
This means when we unregister a service worker manually (like I do for debugging purposes) and then reload the page, there is no service worker available when this code is run.
Adding a check with a more helpful error message should improve UX.
This error might also happen in other cases where a page refresh should also help.
---------
Co-authored-by: ekzyis <ek@stacker.news>
* Merge notifications manually without relying on tag
* Use tag as argument
* Fix title and undefined sats in DEPOSIT push notification
* Remove wrong comment
* Fix wrong var used for tag check
* Also immediately display STREAK notifications
* Close all notifications with same tag manually before
* Fix merge of DEPOSIT notifications
* Remove unused tag from reduce argument
* Remove FIXME(iOS) comment
---------
Co-authored-by: ekzyis <ek@stacker.news>
* Christmas zaps
* Also add 50px margin on left side
* Remove wrong comment
* Use grey snow in light mode
---------
Co-authored-by: ekzyis <ek@stacker.news>