(sub: PushSubscription | null)
| 265 | } |
| 266 | |
| 267 | const doUnsubscribe = (sub: PushSubscription | null) => { |
| 268 | if (sub === null) { |
| 269 | throw new RuntimeError( |
| 270 | RuntimeErrorCode.NOT_SUBSCRIBED_TO_PUSH_NOTIFICATIONS, |
| 271 | (typeof ngDevMode === 'undefined' || ngDevMode) && |
| 272 | 'Not subscribed to push notifications.', |
| 273 | ); |
| 274 | } |
| 275 | |
| 276 | return sub.unsubscribe().then((success) => { |
| 277 | if (!success) { |
| 278 | throw new RuntimeError( |
| 279 | RuntimeErrorCode.PUSH_SUBSCRIPTION_UNSUBSCRIBE_FAILED, |
| 280 | (typeof ngDevMode === 'undefined' || ngDevMode) && 'Unsubscribe failed!', |
| 281 | ); |
| 282 | } |
| 283 | |
| 284 | this.subscriptionChanges.next(null); |
| 285 | }); |
| 286 | }; |
| 287 | |
| 288 | return new Promise((resolve, reject) => { |
| 289 | this.subscription |
nothing calls this directly
no test coverage detected