@ -17,7 +17,6 @@ import { ButtonSettings } from '../button/models/button-settingsl';
import { Events , ModalController } from '@ionic/angular' ;
import { SharedDataService } from '../../services/shared-data-service/shared-data.service' ;
import { DigitalIdComponent } from "src/app/authentication/digital-id/digital-id.component" ;
import { BusinessCardComponent } from "src/app/authentication/business-card/business-card.component" ;
@Component ( {
selector : "welcome-login" ,
@ -76,6 +75,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
user_name : string ;
userInfo : any ;
userBusiness : any ;
showBusinessCard = false ;
constructor (
public ts : TranslatorService ,
@ -94,7 +94,13 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
false
) ;
console . log ( "this.user in welcome login" + this . user ) ;
console . log ( "this.user in welcome login" + JSON . stringify ( this . user ) ) ;
if ( this . user && this . user . BusinessCardPrivilege ) {
this . showBusinessCard = true
} else {
this . showBusinessCard = false ;
}
this . userName = localStorage . getItem ( "user" ) ;
this . password = localStorage . getItem ( "password" ) ;
@ -104,6 +110,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this . lastLoginDate = localStorage . getItem ( "login-at" ) ;
this . userInfo = JSON . parse ( localStorage . getItem ( 'digitalIDUser' ) ) ;
this . userBusiness = JSON . parse ( localStorage . getItem ( 'bussiness-card-info' ) ) ;
console . log ( 'userBusiness' + this . userBusiness ) ;
// this.userBusiness = this.cs.sharedService.getSharedData('bussiness-card-info', false);
@ -229,7 +236,11 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
}
loginWithDigitalID ( ) {
this . confimLogin . checkAccess ( this . logintype , true , this . logintype ) ;
this . confimLogin . checkAccess ( this . logintype , true , this . logintype , false ) ;
}
loginWithBusinessCard() {
this . confimLogin . checkAccess ( this . logintype , false , this . logintype , true ) ;
}
@ -254,16 +265,4 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
return await modal . present ( ) ;
}
async openBusinessCard() {
const modal = await this . modalController . create ( {
component : BusinessCardComponent ,
cssClass : 'digital-id-modal-css' ,
componentProps : {
'userInfo' : this . userBusiness
}
} ) ;
return await modal . present ( ) ;
}
}