1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

refactor broadcaster service

This commit is contained in:
Kyle Spearrin
2018-02-10 15:22:07 -05:00
parent f072258d5c
commit b41a38afbb
4 changed files with 44 additions and 6 deletions

View File

@@ -41,6 +41,7 @@ import { MessagingService } from 'jslib/abstractions/messaging.service';
import { SyncService } from 'jslib/abstractions/sync.service';
const SyncInterval = 6 * 60 * 60 * 1000; // 6 hours
const BroadcasterSubscriptionId = 'VaultComponent';
@Component({
selector: 'app-vault',
@@ -72,7 +73,7 @@ export class VaultComponent implements OnInit, OnDestroy {
}
async ngOnInit() {
this.broadcasterService.subscribe((message: any) => {
this.broadcasterService.subscribe(BroadcasterSubscriptionId, (message: any) => {
this.ngZone.run(async () => {
let detectChanges = true;
@@ -145,7 +146,7 @@ export class VaultComponent implements OnInit, OnDestroy {
}
ngOnDestroy() {
this.broadcasterService.unsubscribe();
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
}
async load() {