Removed the need for the messageing service to be in app.component.ts
This commit is contained in:
parent
22a00b2341
commit
d323e775ca
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue