From 45da8aa9eb4dd7e12c9fa67ed09189bc4d5ed2f1 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 28 Aug 2018 08:38:19 -0400 Subject: [PATCH] support for logout notification --- src/enums/notificationType.ts | 2 ++ src/services/notifications.service.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/enums/notificationType.ts b/src/enums/notificationType.ts index 2ceddadd5d..4b655404e7 100644 --- a/src/enums/notificationType.ts +++ b/src/enums/notificationType.ts @@ -11,4 +11,6 @@ export enum NotificationType { SyncFolderUpdate = 8, SyncCipherDelete = 9, SyncSettings = 10, + + LogOut = 11, } diff --git a/src/services/notifications.service.ts b/src/services/notifications.service.ts index 04be09e021..ff832c4136 100644 --- a/src/services/notifications.service.ts +++ b/src/services/notifications.service.ts @@ -27,7 +27,7 @@ export class NotificationsService implements NotificationsServiceAbstraction { constructor(private userService: UserService, private syncService: SyncService, private appIdService: AppIdService, private apiService: ApiService, - private cryptoService: CryptoService) { } + private cryptoService: CryptoService, private logoutCallback: () => Promise) { } async init(environmentService: EnvironmentService): Promise { this.inited = false; @@ -136,6 +136,9 @@ export class NotificationsService implements NotificationsServiceAbstraction { // Stop so a reconnect can be made await this.signalrConnection.stop(); break; + case NotificationType.LogOut: + this.logoutCallback(); + break; default: break; }