1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-26 17:08:33 +01:00

Removed the need for the messageing service to be in app.component.ts

This commit is contained in:
syntaxerror752 2020-05-31 22:02:41 +10:00
parent 22a00b2341
commit d323e775ca

View File

@ -35,7 +35,6 @@ import { CryptoService } from 'jslib/abstractions/crypto.service';
import { EventService } from 'jslib/abstractions/event.service';
import { FolderService } from 'jslib/abstractions/folder.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { MessagingService } from 'jslib/abstractions/messaging.service';
import { NotificationsService } from 'jslib/abstractions/notifications.service';
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
@ -85,7 +84,7 @@ export class AppComponent implements OnDestroy, OnInit {
private sanitizer: DomSanitizer, private searchService: SearchService,
private notificationsService: NotificationsService, private routerService: RouterService,
private stateService: StateService, private eventService: EventService,
private policyService: PolicyService, private messagingService: MessagingService) { }
private policyService: PolicyService) { }
ngOnInit() {
this.ngZone.runOutsideAngular(() => {
@ -151,7 +150,6 @@ export class AppComponent implements OnDestroy, OnInit {
});
break;
case 'setFullWidth':
this.enableFullWidth = await this.storageService.get<boolean>('enableFullWidth');
this.setFullWidth();
break;
default:
@ -172,7 +170,7 @@ export class AppComponent implements OnDestroy, OnInit {
}
}
});
this.messagingService.send('setFullWidth');
this.setFullWidth();
}
ngOnDestroy() {
@ -271,6 +269,7 @@ export class AppComponent implements OnDestroy, OnInit {
}
private async setFullWidth() {
this.enableFullWidth = await this.storageService.get<boolean>('enableFullWidth');
if (this.enableFullWidth) {
document.body.classList.add('full-width');
} else {