refresh issue fix

This commit is contained in:
Surendiran 2023-09-05 18:18:55 +05:30
parent af86f4a33b
commit f033848bc7
3 changed files with 16 additions and 18 deletions

View File

@ -69,9 +69,13 @@ export class LoginComponent implements OnInit {
localStorage.setItem('email',JSON.stringify(auth))
this.disable= true
this.showToast('success', 'Login Successfully', 'Welcome..!');
setTimeout(() => {
this.router.navigate(['/home'])
}, 500);
if(res.role == 'FRONT-OFFICE'){
this.router.navigate(['/home'])
}else{
this.router.navigate(['/pages/dashboard'])
}
}

View File

@ -294,7 +294,7 @@
<nb-option value="Out For Delivery" >Out For Delivery</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>
<!-- <label for="subject">Drivers:</label> <br /> -->

View File

@ -19,22 +19,16 @@ export class PagesComponent {
menu = MENU_ITEMS;
constructor(private router: Router){
let role = localStorage.getItem('user_role')
console.log(role)
constructor(private router: Router){}
ngOnInit() {
const role = localStorage.getItem('user_role');
console.log(role);
if(role == "FRONT-OFFICE"){
this.menu = this.menu.filter(arr=>{return arr.title != 'Users'})
if (role === 'FRONT-OFFICE') {
this.menu = this.menu.filter((item) => item.title !== 'Users');
}
console.log(this.menu)
this.router.navigate(['/pages/dashboard']);
console.log(this.menu);
}
}