mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
chat retry
This commit is contained in:
@@ -4,6 +4,7 @@ import { Observable } from 'rxjs';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { AlertController, Platform } from '@ionic/angular';
|
||||
import { PermissionService } from '../services/permission.service';
|
||||
import { FirstEnterService } from '../services/first-enter.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -14,7 +15,8 @@ export class InactivityGuard implements CanActivate {
|
||||
private router:Router,
|
||||
private platform: Platform,
|
||||
public p: PermissionService,
|
||||
private alertController: AlertController
|
||||
private alertController: AlertController,
|
||||
private FirstEnterService: FirstEnterService
|
||||
) {}
|
||||
|
||||
canActivate(
|
||||
@@ -24,30 +26,8 @@ export class InactivityGuard implements CanActivate {
|
||||
console.log('hire inactinity!', state.url)
|
||||
|
||||
if ( (this.platform.is('desktop') || this.platform.is('mobileweb')) ) {
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
||||
|
||||
}
|
||||
else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
|
||||
this.router.navigate(['/home/chat']);
|
||||
}
|
||||
else if(this.p.userPermission(this.p.permissionList.Actions.access)) {
|
||||
this.router.navigate(['/home/publications']);
|
||||
} else {
|
||||
|
||||
this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Utilizador sem acesso a aplicação',
|
||||
buttons: [{
|
||||
text: 'Ok',
|
||||
handler: () => {
|
||||
|
||||
}
|
||||
}]
|
||||
}).then( async (alertPopup) => {
|
||||
await alertPopup.present();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
this.FirstEnterService.enter()
|
||||
|
||||
return false
|
||||
} else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
||||
@@ -68,28 +48,8 @@ export class InactivityGuard implements CanActivate {
|
||||
else {
|
||||
|
||||
if((SessionStore?.user?.Inactivity)) {
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
|
||||
this.router.navigate(['/home/chat']);
|
||||
}
|
||||
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
|
||||
this.router.navigate(['/home/publications']);
|
||||
} else {
|
||||
this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Utilizador sem acesso a aplicação',
|
||||
buttons: [{
|
||||
text: 'Ok',
|
||||
handler: () => {
|
||||
|
||||
}
|
||||
}]
|
||||
}).then( async (alertPopup)=>{
|
||||
await alertPopup.present();
|
||||
})
|
||||
}
|
||||
this.FirstEnterService.enter()
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user