Commit Graph

40 Commits (7582be1a39b28fb871f42e6b5ca12a940978caf9)

Author SHA1 Message Date
nimbleghost e8216ae9e7 Fix resubscribing when notifications are re-granted
(case: from denied to granted)
2023-06-29 00:02:18 +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 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
binwiederhier 5627097a6c Remove WebPush.js, move to hooks.js; add docblocks 2023-06-25 21:46:26 -04:00
binwiederhier 94fb23ba17 Style changes 2023-06-25 21:10:25 -04:00
nimbleghost 833293ad77 Set PWA web push enabled on launch instead 2023-06-25 22:00:45 +02:00
nimbleghost a8d3297c4e Correctly handle standalone (PWA) mode changes
- Also handle notification permission changes
- Remove web push schedule worker since this complicates
  things and doesn’t do _that_ much. We have the reminder
  notification if the user truly doesn’t reload ntfy in
  more than a week.
2023-06-25 21:25:52 +02:00
nimbleghost 30a8f66db2 Reorder start/stopWorkers 2023-06-17 22:32:24 +02:00
nimbleghost b197ea3ab6 Use the same notification pipeline everywhere
This means less duplication and `actions` support for all
notifications.
2023-06-15 00:43:18 +02:00
binwiederhier 7083ed9f6b Move websocketSubscriptions to useConnectionListeners 2023-06-14 08:18:55 -04: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 9d5556c7f5 Rename things, add comments 2023-06-10 20:42:02 -04:00
nimbleghost 0f0074cbab Implement push subscription expiry 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 453bf435b0 Fix account sync race condition 2023-05-31 19:37:29 +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
binwiederhier ca5d736a71 Line width 2023-05-23 19:29:47 -04:00
nimbleghost 6f6a2d1f69 Run prettier 2023-05-23 21:13:17 +02:00
binwiederhier cc309e87e9 Remove awkward subscription id 2023-02-12 14:09:44 -05:00
binwiederhier 0885951a67 JS error handling 2023-02-02 15:19:37 -05:00
binwiederhier 1771cb3fdb No flickering for sync topic 2023-01-24 15:31:39 -05:00
binwiederhier 3bd6518309 Fix a bunch of FIXMEs 2023-01-18 15:50:06 -05:00
binwiederhier fdee54f921 Account sync in action 2023-01-11 21:38:10 -05:00
binwiederhier 3280c2c440 Upgrade banner 2023-01-04 22:47:12 -05:00
binwiederhier bb583eaa72 Automatic account sync with react 2023-01-02 22:21:11 -05:00
binwiederhier 95a8e64fbb Figure out user manager for account user 2022-12-26 21:27:07 -05:00
binwiederhier 7ae8049438 Extend session token from web app 2022-12-25 13:42:44 -05:00
binwiederhier 276301dc87 Split out AccountApi 2022-12-25 11:59:44 -05:00
binwiederhier 3aac1b2715 Redirect UI if unauthorized API response 2022-12-24 15:51:22 -05:00
binwiederhier d982ce13f5 UI work, config.js stuff 2022-12-21 13:19:07 -05:00
binwiederhier c2f16f740b Stuff 2022-12-14 23:11:22 -05:00
Philipp Heckel 92bf7ebc52 blerp 2022-12-08 20:50:48 -05:00
Philipp Heckel 182e21a9c3 Fix pruning bug in web app (closes #186), release notes, remove local storage migration 2022-03-27 09:20:25 -04:00
Philipp Heckel 70538783d8 Fix one-off migration 2022-03-11 15:32:24 -05:00
Philipp Heckel 09336fa1e4 Comments 2022-03-11 15:17:12 -05:00
Philipp Heckel c124434429 Migrate topics from old web ui; nicer stack traces 2022-03-11 14:43:54 -05:00
Philipp Heckel 840cb5b182 Add server-generated /config.js; add error boundary 2022-03-09 23:28:55 -05:00