refresh issue fix
This commit is contained in:
parent
af86f4a33b
commit
f033848bc7
@ -69,9 +69,13 @@ export class LoginComponent implements OnInit {
|
|||||||
localStorage.setItem('email',JSON.stringify(auth))
|
localStorage.setItem('email',JSON.stringify(auth))
|
||||||
this.disable= true
|
this.disable= true
|
||||||
this.showToast('success', 'Login Successfully', 'Welcome..!');
|
this.showToast('success', 'Login Successfully', 'Welcome..!');
|
||||||
setTimeout(() => {
|
|
||||||
this.router.navigate(['/home'])
|
if(res.role == 'FRONT-OFFICE'){
|
||||||
}, 500);
|
this.router.navigate(['/home'])
|
||||||
|
}else{
|
||||||
|
this.router.navigate(['/pages/dashboard'])
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -294,7 +294,7 @@
|
|||||||
<nb-option value="Out For Delivery" >Out For Delivery</nb-option>
|
<nb-option value="Out For Delivery" >Out For Delivery</nb-option>
|
||||||
|
|
||||||
<!-- <nb-option value="Delivered" >Delivered</nb-option> -->
|
<!-- <nb-option value="Delivered" >Delivered</nb-option> -->
|
||||||
<nb-option value="Cancelled" >Cancelled</nb-option>
|
<!-- <nb-option value="Cancelled" >Cancelled</nb-option> -->
|
||||||
|
|
||||||
</nb-select>
|
</nb-select>
|
||||||
<!-- <label for="subject">Drivers:</label> <br /> -->
|
<!-- <label for="subject">Drivers:</label> <br /> -->
|
||||||
|
|||||||
@ -19,22 +19,16 @@ export class PagesComponent {
|
|||||||
|
|
||||||
menu = MENU_ITEMS;
|
menu = MENU_ITEMS;
|
||||||
|
|
||||||
constructor(private router: Router){
|
constructor(private router: Router){}
|
||||||
let role = localStorage.getItem('user_role')
|
|
||||||
console.log(role)
|
ngOnInit() {
|
||||||
|
const role = localStorage.getItem('user_role');
|
||||||
|
console.log(role);
|
||||||
|
|
||||||
if(role == "FRONT-OFFICE"){
|
if (role === 'FRONT-OFFICE') {
|
||||||
this.menu = this.menu.filter(arr=>{return arr.title != 'Users'})
|
this.menu = this.menu.filter((item) => item.title !== 'Users');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(this.menu);
|
||||||
console.log(this.menu)
|
|
||||||
|
|
||||||
this.router.navigate(['/pages/dashboard']);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user