diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index 08179d5e..734c72a5 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -140,6 +140,8 @@ export class LoginComponent implements OnInit, OnDestroy { const remember = localStorage.getItem('remember'); // ****// this.empname = localStorage.getItem('emp-name'); this.logintype = localStorage.getItem('login-type'); + // tslint:disable-next-line: radix + this.currentLang = parseInt(localStorage.getItem('lang')); // tslint:disable-next-line: triple-equals if (remember == 'true') { this.remeberMe = true; } else { this.remeberMe = false; } } @@ -184,6 +186,7 @@ export class LoginComponent implements OnInit, OnDestroy { public remeberMyInfo() { if (this.username) {localStorage.setItem('user', this.username); } if (this.password) {localStorage.setItem('password', this.password); } + if (this.currentLang) {localStorage.setItem('lang', this.currentLang.toString()); } localStorage.setItem('remember', 'true'); } @@ -353,6 +356,11 @@ export class LoginComponent implements OnInit, OnDestroy { } login() { + let anotherUser = this.sharedData.getSharedData('anotherUser'); + if(anotherUser){ + this.username = ''; + this.password = ''; + } console.log('login emit'); console.log('login'); // this.checkUserAuthentication(); diff --git a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html index 554414ee..9f4f7175 100644 --- a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html +++ b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts index b204d12d..65bc8ecc 100644 --- a/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts +++ b/Mohem/src/app/hmg-common/ui/stats-button/stats-button.component.ts @@ -16,6 +16,7 @@ export class StatsButtonComponent implements OnInit { @Output() trigger = new EventEmitter(); @Input() focusicon: string; @Input() disabled = false; + @Input() show: boolean ; public direction: string; public style: any; constructor( diff --git a/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.ts b/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.ts index aa5abdec..13d24628 100644 --- a/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.ts +++ b/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.ts @@ -15,6 +15,7 @@ import { ConfirmLoginComponent } from 'src/app/authentication/confirm-login/conf import * as moment from 'moment' import { ButtonSettings } from '../button/models/button-settingsl'; import { Events } from '@ionic/angular'; +import { SharedDataService } from '../../services/shared-data-service/shared-data.service'; @Component({ selector: "welcome-login", @@ -76,7 +77,8 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy { public ts: TranslatorService, public cs: CommonService, public authservice: AuthenticationService, - public events: Events + public events: Events, + public sharedData: SharedDataService, ) { } ngOnInit() { @@ -209,6 +211,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy { login() { + this.sharedData.setSharedData(true, "anotherUser") this.onLogin.emit(); } loginwithuser() { diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html index 1466b033..80949b95 100644 --- a/Mohem/src/app/home/home.page.html +++ b/Mohem/src/app/home/home.page.html @@ -14,6 +14,7 @@ [title]="button.title" [statsValue]="button.statsValue" [icon]="button.icon" + [show]="button.show" (click)="openStatsButton(button.link)"> @@ -46,7 +47,7 @@ [icon]="subMenu.ICON"> - +