aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/app.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/app.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/app.js b/packages/meshbay-hub/src/meshbay_hub/static/app.js
index b9466d0..2254a11 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/app.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/app.js
@@ -31,6 +31,7 @@ import {
} from './playlists.js';
import { IndexingDock } from './index-dock.js';
import { SettingsPage } from './settings-page.js';
+import { syncPush, disablePush } from './push.js';
import { ProfilePage } from './profile-page.js';
import { ExplorePage } from './explore-page.js';
import { GroupName } from './group-name.js';
@@ -1042,6 +1043,7 @@ function App() {
.catch(() => {});
refreshNodeKey();
fetchNotifications();
+ syncPush(user).catch(() => {});
}, [user]);
// The node this application ships, set up, started and linked for whoever
@@ -1233,6 +1235,13 @@ function App() {
// Navigating away leaves transfers running; signing out does not. They
// are moving data on tokens that are about to stop being ours.
transfers.reset();
+ // This phone stops being told about the account it is leaving. Its
+ // access token is still good for that request; the refresh token's
+ // revocation below does not touch it.
+ // The stored session, read now: React's copy can be a renewal behind,
+ // and once the session is cleared nothing could renew it.
+ disablePush(user && { ...user, token: (loadAuth() || {}).token || user.token })
+ .catch(() => {});
// Revoked on the hub too, so a copy of the refresh token is worth
// nothing. Read before the next line clears it.
logoutOnHub();