support for logout notification

This commit is contained in:
Kyle Spearrin 2018-08-28 08:38:19 -04:00
parent 3c43265878
commit 45da8aa9eb
2 changed files with 6 additions and 1 deletions

View File

@ -11,4 +11,6 @@ export enum NotificationType {
SyncFolderUpdate = 8,
SyncCipherDelete = 9,
SyncSettings = 10,
LogOut = 11,
}

View File

@ -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<void>) { }
async init(environmentService: EnvironmentService): Promise<void> {
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;
}