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
1 changed files with 3 additions and 4 deletions

View File

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