diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-11-23 09:52:45 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-11-23 09:52:45 +0900 |
| commit | 19424729a3716e9fdcfc64e010d54b72de72b67c (patch) | |
| tree | cbb40844950e1bde7931baf0256d371d8d9fe973 /src | |
| parent | Update mios.ts (diff) | |
| download | sharkey-19424729a3716e9fdcfc64e010d54b72de72b67c.tar.gz sharkey-19424729a3716e9fdcfc64e010d54b72de72b67c.tar.bz2 sharkey-19424729a3716e9fdcfc64e010d54b72de72b67c.zip | |
:v:
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/app/common/mios.ts | 12 |
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)のサブスクリプションが // 既に存在していることが原因でエラーになった可能性があるので、 // そのサブスクリプションを解除しておく |