diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts
index b517eacd..84068821 100644
--- a/Mohem/src/app/app.component.ts
+++ b/Mohem/src/app/app.component.ts
@@ -1,36 +1,81 @@
-import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
-import { Platform, Events, MenuController } from '@ionic/angular';
-import { StatusBar } from '@ionic-native/status-bar/ngx';
-import { TranslatorService } from './hmg-common/services/translator/translator.service';
-import { CommonService } from './hmg-common/services/common/common.service';
-import { AuthenticationService } from './hmg-common/services/authentication/authentication.service';
-import { AuthenticatedUser } from './hmg-common/services/authentication/models/authenticated-user';
-import { TabsBarComponent } from './hmg-common/ui/tabs-bar/tabs-bar.component';
-import { KeyboardService } from './hmg-common/services/keyboard/keyboard.service';
-import { Router, RouteConfigLoadStart, RouteConfigLoadEnd, NavigationStart, NavigationEnd, NavigationCancel } from '@angular/router';
-import { LazyLoadingService } from './hmg-common/services/lazy-loading/lazy-loading.service';
+import { Component, OnInit, ViewChild, AfterViewInit } from "@angular/core";
+import { Platform, Events, MenuController } from "@ionic/angular";
+import { TranslatorService } from "./hmg-common/services/translator/translator.service";
+import { CommonService } from "./hmg-common/services/common/common.service";
+import { AuthenticationService } from "./hmg-common/services/authentication/authentication.service";
+import { AuthenticatedUser } from "./hmg-common/services/authentication/models/authenticated-user";
+import { TabsBarComponent } from "./hmg-common/ui/tabs-bar/tabs-bar.component";
+import { KeyboardService } from "./hmg-common/services/keyboard/keyboard.service";
+
+import { LazyLoadingService } from "./hmg-common/services/lazy-loading/lazy-loading.service";
@Component({
- selector: 'app-root',
- styleUrls: ['./app.component.scss'],
- templateUrl: 'app.component.html'
+ selector: "app-root",
+ styleUrls: ["./app.component.scss"],
+ templateUrl: "app.component.html"
})
export class AppComponent implements OnInit, AfterViewInit {
// rootPage:any = LoginPage;
// @ViewChild(Nav) nav: Nav;
-
- menuList:any=[];
- User_name_Emp:string="";
- user_image:string="";
- menuSide:string="left";
- notBadge:number;
- companyUrl:string="../assets/imgs/CS.png";
- companyDesc:string="Powered By Cloud Solutions";
- public direction = 'ltr';
- ngOnInit(){
-
- }
- ngAfterViewInit(){
-
- }
+ start: any = false;
+ menuList: any = [];
+ User_name_Emp: string = "";
+ user_image: string = "";
+ menuSide: string = "left";
+ notBadge: number;
+ companyUrl: string = "../assets/imgs/CS.png";
+ companyDesc: string = "Powered By Cloud Solutions";
+ public direction = "ltr";
+ constructor(
+ public translatorService: TranslatorService,
+ private cs: CommonService,
+ private lazyLoadingService: LazyLoadingService,
+ private platform: Platform,
+ private events: Events,
+ private keyboardService: KeyboardService,
+ private menu: MenuController
+ ) {}
+ ngOnInit() {
+ this.initializeApp();
+ }
+ ngAfterViewInit() {}
+ initializeApp() {
+
+ this.start = false;
+ this.lazyLoadingService.monitorLazyLoading(15, true);
+ this.platform.ready().then(() => {
+ this.translatorService.loadResources(() => {
+ this.initializeDirection();
+ // this.statusBar.styleDefault();
+ this.start = true;
+ this.watchLanguageChangeEvents();
+ // this.checkIfUserLoggedInBefore();
+ this.keyboardService.watchKeyboard();
+ });
+ });
+ }
+ private initializeDirection() {
+ this.direction = TranslatorService.getCurrentDirection();
+ }
+ private watchUserLoginChangeEvents() {
+ this.events.subscribe(
+ AuthenticationService.LOGIN_EVENT,
+ (user: AuthenticatedUser, time: Date) => {
+ // if (user) {
+ // this.loggedInMainUser = user;
+ // this.loggedInUser = user;
+ // this.loadFamilyMembers();
+ // }
+ }
+ );
+ }
+ private watchLanguageChangeEvents() {
+ this.events.subscribe(TranslatorService.CHANGE_EVENT, () => {
+ this.start = false;
+ this.initializeDirection();
+ setTimeout(() => {
+ this.start = true;
+ }, 100);
+ });
+ }
}
diff --git a/Mohem/src/app/authentication/login/login.component.html b/Mohem/src/app/authentication/login/login.component.html
index 2ff2cd15..6ec76f1e 100644
--- a/Mohem/src/app/authentication/login/login.component.html
+++ b/Mohem/src/app/authentication/login/login.component.html
@@ -8,21 +8,21 @@
{{'login,title' | translate}} {{ts.trPK('login','login')}}
-
-