Page MenuHomePhabricator

[Cashtab] [notification permission 2 of 2] Show modal after user notification decision
ClosedPublic

Authored by bytesofman on Dec 16 2022, 18:28.

Details

Summary

T2882

Depends on D12905

Show a modal that refreshes the page after the user accepts notification permissions.

Show a warning modal on load if Cashtab has notification permission denied and peristent storage denied.

Test Plan
npm run build
netlify deploy

Open the URL netlify has deployed the site to (the dev deploy URL should be new every time).

Open the dev console.

Note the site opens with an "ask for notification permission" request.

Accept the request.

Note the success modal.

Click okay. Note page refreshes and peristent storage status is granted.

Redeploy to a new URL (netlify deploy should do this automatically if you don't use the --prod flag)
Reject the notification permission
Note the warning modal
Note the warning modal appears on load every time if persistent storage is false and notification permission is not granted

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

While this diff possibly solves the storage clear problem, we should be mindful of the user annoyance of always having the warning modal pop up on load. If the user denies notification permission, as many users do automatically, this diff will always show the modal on load. The browser will not ask for notification permission again after it's been denied, so such users must enable it manually.;

It could be better UX to fail silently if it's denied. However, that would mean many users continue to use Cashtab without persistent storage.

Note: I also tested this with installed PWA by adding a quick info modal that tells you the status of persistent storage on load.

For the PWA, persistent storage is false -- but, after accepting notificaton permissions, it is true (at least in Brave).

This revision is now accepted and ready to land.Dec 19 2022, 02:47