summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-11-23 09:52:45 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-11-23 09:52:45 +0900
commit19424729a3716e9fdcfc64e010d54b72de72b67c (patch)
treecbb40844950e1bde7931baf0256d371d8d9fe973 /src
parentUpdate mios.ts (diff)
downloadsharkey-19424729a3716e9fdcfc64e010d54b72de72b67c.tar.gz
sharkey-19424729a3716e9fdcfc64e010d54b72de72b67c.tar.bz2
sharkey-19424729a3716e9fdcfc64e010d54b72de72b67c.zip
:v:
Diffstat (limited to 'src')
-rw-r--r--src/web/app/common/mios.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/web/app/common/mios.ts b/src/web/app/common/mios.ts
index dfc83c18c6..6ee42ea8a7 100644
--- a/src/web/app/common/mios.ts
+++ b/src/web/app/common/mios.ts
@@ -257,11 +257,17 @@ export default class MiOS extends EventEmitter {
auth: encode(subscription.getKey('auth')),
publickey: encode(subscription.getKey('p256dh'))
});
- }).then(() => {
- this.logInfo('[sw] Server Stored Subscription.');
- }).catch(async (err) => {
+ })
+ // When subscribe failed
+ .catch(async (err: Error) => {
this.logError('[sw] Subscribe Error:', err);
+ // 通知が許可されていなかったとき
+ if (err.name == 'NotAllowedError') {
+ this.logError('[sw] Subscribe failed due to notification not allowed');
+ return;
+ }
+
// 違うapplicationServerKey (または gcm_sender_id)のサブスクリプションが
// 既に存在していることが原因でエラーになった可能性があるので、
// そのサブスクリプションを解除しておく