Commit Graph

23 Commits (7582be1a39b28fb871f42e6b5ca12a940978caf9)

Author SHA1 Message Date
nimbleghost 365a0b2832 Fix preferences warnings 2023-06-28 23:38:57 +02:00
nimbleghost 9ce3545901 Fix refreshing things when permission is granted
We refreshed some things but not everything, this makes it more
responsive if you have the settings page open when granting permissions,
for example.
2023-06-28 20:26:54 +02:00
binwiederhier 64ac111d55 Rename UI_MODE to THEME 2023-06-28 13:30:51 -04:00
nimbleghost 4828e3a691 Add preference 2023-06-28 17:39:44 +02:00
nimbleghost 4f39c7c155 Implement dark mode
Resolves #206
2023-06-28 16:52:35 +02:00
nimbleghost dabb6a481f Add server name to background notification setting 2023-06-28 08:44:05 +02:00
binwiederhier 12df164245 Formatting 2023-06-26 20:38:18 -04:00
nimbleghost 175ab5ea76 Fix: refresh web push pref on standalone change 2023-06-26 08:56:07 +02:00
nimbleghost 48d1f7887d Default web push to enabled on PWAs 2023-06-24 20:22:34 +02:00
nimbleghost e2120bc66d Improve WebPushEnabled conditional display 2023-06-14 14:33:35 +02:00
binwiederhier 790fd43369 Tiny changes 2023-06-14 08:04:16 -04:00
nimbleghost 390d42c607 Format & fix lint 2023-06-13 14:02:54 +02:00
nimbleghost 8ccfa5c3fb Fix session replica behaviour (merge with session)
The harder-to-refactor parts are the places where exists/username/token
are called within a React component. However, `resetAndRedirect` and
`store` are already called from async contexts, so adding an `await`
is simple.

This thus merges the logic, keeping localStorage for the components to
call, but making sure reset/store behaviour works correctly for the
replica.
2023-06-13 14:00:51 +02:00
binwiederhier eb220544a3 Change wording in prefs based on setting 2023-06-10 20:51:24 -04:00
binwiederhier 75a4b5bd88 Small refactor 2023-06-08 12:20:12 -04:00
nimbleghost 46798ac322 Make web push toggle global 2023-06-08 10:46:51 +02:00
nimbleghost 03aa67ed68 Remove `webPushDefaultEnabled` 2023-06-07 21:09:13 +02:00
nimbleghost 47ad024ec7 Simplify web push UX and updates
- Use a single endpoint
- Use a declarative web push sync hook. This thus handles all edge cases
  that had to be manually handled before: logout, login, account sync,
  etc.
- Simplify UX: browser notifications are always enabled (unless denied),
  web push toggle only shows up if permissions are already granted.
2023-06-07 20:38:21 +02:00
nimbleghost ff5c854192 Add PWA, service worker and Web Push
- Use new notification request/opt-in flow for push
- Implement unsubscribing
- Implement muting
- Implement emojis in title
- Add iOS specific PWA warning
- Don’t use websockets when web push is enabled
- Fix duplicate notifications
- Implement default web push setting
- Implement changing subscription type
- Implement web push subscription refresh
- Implement web push notification click
2023-06-07 20:38:20 +02:00
nimbleghost d625a003b8 Use esm mui imports for Vite compatibility
See: https://github.com/mui/material-ui/issues/31835#issuecomment-1153393901
2023-05-24 22:16:10 +02:00
nimbleghost 59011c8a32 Make manual eslint fixes
These are safe fixes, more complicated fixes can be done separately
(just disabled those errors for now).

- Reorder declarations to fix `no-use-before-define`
- Rename parameters for `no-shadow`
- Remove unused parameters, functions, imports
- Switch from `++` and `—` to `+= 1` and `-= 1` for `no-unary`
- Use object spreading instead of parameter reassignment in auth utils
- Use `window.location` instead of `location` global
- Use inline JSX strings instead of unescaped values
-
2023-05-24 12:58:48 +02:00
nimbleghost 8319f1cf26 Run eslint autofixes 2023-05-24 12:51:53 +02:00
nimbleghost f558b4dbe9 Add `.jsx` filename extension
(This is also required for Vite later)
2023-05-24 12:51:53 +02:00