1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

always set inactive state first

This commit is contained in:
Kyle Spearrin
2018-08-24 15:21:28 -04:00
parent bc198c60d1
commit c0fd5f71f8

View File

@@ -88,21 +88,15 @@ export class NotificationsService implements NotificationsServiceAbstraction {
} }
async reconnectFromActivity(): Promise<void> { async reconnectFromActivity(): Promise<void> {
if (!this.inited) {
return;
}
this.inactive = false; this.inactive = false;
if (!this.connected) { if (this.inited && !this.connected) {
await this.reconnect(true); await this.reconnect(true);
} }
} }
async disconnectFromInactivity(): Promise<void> { async disconnectFromInactivity(): Promise<void> {
if (!this.inited) {
return;
}
this.inactive = true; this.inactive = true;
if (this.connected) { if (this.inited && this.connected) {
await this.signalrConnection.stop(); await this.signalrConnection.stop();
} }
} }