Skip to content

Commit 5582cfc

Browse files
committed
Unsubscribe when logging out
1 parent b5f4c20 commit 5582cfc

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

src/accounthelper/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,19 @@ async function checkSessionCookie() {
4343
return json;
4444
}
4545
lastValidationState = null;
46+
(async function () {
47+
try{
48+
await pushNotificationHelper.__unsubscribe()
49+
}catch(e){}
50+
})();
4651
return false;
4752
} catch (e) {
4853
lastValidationState = null;
54+
(async function () {
55+
try{
56+
await pushNotificationHelper.__unsubscribe()
57+
}catch(e){}
58+
})();
4959
return false;
5060
}
5161
}
@@ -83,9 +93,19 @@ async function signupAccount(username, password, robot_check_id) {
8393
}
8494

8595
async function logoutOfAccount() {
96+
(async function () {
97+
try{
98+
await pushNotificationHelper.unsubscribe()
99+
}catch(e){}
100+
})();
86101
var request = await fetch(getServerURL() + "/account/logout", {
87102
method: "POST",
88103
});
104+
(async function () {
105+
try{
106+
await pushNotificationHelper.__unsubscribe()
107+
}catch(e){}
108+
})();
89109
}
90110

91111
function getProfilePictureURL(username) {

wpstatic/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"timestamp":"1770741134018"}
1+
{"timestamp":"1770742963099"}

0 commit comments

Comments
 (0)