summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-11-23 06:26:22 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-11-23 06:26:22 +0900
commit5639b78c62fe96c8594e07388fabead07738869b (patch)
tree716be107442ada4a37cd8446be72de55299f4a16 /src/web
parentdevDependencies廃止 (diff)
downloadmisskey-5639b78c62fe96c8594e07388fabead07738869b.tar.gz
misskey-5639b78c62fe96c8594e07388fabead07738869b.tar.bz2
misskey-5639b78c62fe96c8594e07388fabead07738869b.zip
Fix bug
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/common/mios.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/web/app/common/mios.ts b/src/web/app/common/mios.ts
index 7f9aacc46c..e73a65bff8 100644
--- a/src/web/app/common/mios.ts
+++ b/src/web/app/common/mios.ts
@@ -257,8 +257,14 @@ export default class MiOS extends EventEmitter {
});
}).then(() => {
this.logInfo('[sw] Server Stored Subscription.');
- }).catch(err => {
+ }).catch(async (err) => {
this.logError('[sw] Subscribe Error:', err);
+
+ // 違うapplicationServerKey (または gcm_sender_id)のサブスクリプションが
+ // 既に存在していることが原因でエラーになった可能性があるので、
+ // そのサブスクリプションを解除しておく
+ const subscription = await this.swRegistration.pushManager.getSubscription();
+ if (subscription) subscription.unsubscribe();
});
});