mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
improv
This commit is contained in:
@@ -22,30 +22,17 @@ export class InactivityGuard implements CanActivate {
|
||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
|
||||
|
||||
if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
||||
return true
|
||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
|
||||
return true
|
||||
}//Mobile or Tablet without session
|
||||
else {
|
||||
|
||||
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)){
|
||||
//When user has got access to Agenda but does not have their own calendar, goes to Agenda
|
||||
if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
|
||||
this.router.navigate(['/home/agenda']);
|
||||
}
|
||||
else{
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
//If user has access permission to both Chat and Action, goes to Chat by default.
|
||||
else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.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 {
|
||||
} else {
|
||||
|
||||
this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Utilizador sem acesso a aplicação',
|
||||
@@ -58,6 +45,38 @@ export class InactivityGuard implements CanActivate {
|
||||
}).then( async (alertPopup) => {
|
||||
await alertPopup.present();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
return false
|
||||
} else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
||||
return true
|
||||
} else if(SessionStore.exist && !SessionStore.user.Inactivity) {
|
||||
return true
|
||||
}//Mobile or Tablet without session
|
||||
else {
|
||||
|
||||
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();
|
||||
})
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
|
||||
|
||||
})
|
||||
VoiceRecorder.requestAudioRecordingPermission();
|
||||
|
||||
//this.loadFiles();
|
||||
}
|
||||
|
||||
@@ -289,6 +289,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
async startRecording() {
|
||||
VoiceRecorder.requestAudioRecordingPermission();
|
||||
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
|
||||
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
|
||||
//if(await this.hasAudioRecordingPermission()){
|
||||
|
||||
@@ -159,7 +159,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
|
||||
|
||||
})
|
||||
VoiceRecorder.requestAudioRecordingPermission();
|
||||
|
||||
this.getChatMembers();
|
||||
}
|
||||
|
||||
@@ -222,6 +222,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
async startRecording() {
|
||||
VoiceRecorder.requestAudioRecordingPermission();
|
||||
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
|
||||
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
|
||||
//if(await this.hasAudioRecordingPermission()){
|
||||
|
||||
@@ -120,7 +120,7 @@ export class NewGroupPage implements OnInit {
|
||||
return await popover.present();
|
||||
}
|
||||
|
||||
async showPicker(){
|
||||
async showPicker() {
|
||||
const picker = await this.pickerController.create({
|
||||
cssClass: '',
|
||||
buttons: [
|
||||
|
||||
+1
-2
@@ -324,8 +324,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
loader.remove()
|
||||
}
|
||||
}
|
||||
else{
|
||||
// alert(JSON.stringify(this.task))
|
||||
else {
|
||||
this.toastService._successMessage('Não é possível marcar a reunião de momento');
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
}, 1000);
|
||||
this.getChatMembers();
|
||||
//this.getMessageDB();
|
||||
VoiceRecorder.requestAudioRecordingPermission();
|
||||
|
||||
this.deleteRecording();
|
||||
this.loadFiles();
|
||||
}
|
||||
@@ -298,6 +298,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
}
|
||||
|
||||
async startRecording() {
|
||||
VoiceRecorder.requestAudioRecordingPermission();
|
||||
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
|
||||
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
|
||||
//if(await this.hasAudioRecordingPermission()){
|
||||
|
||||
@@ -157,7 +157,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.scrollToBottom();
|
||||
|
||||
this.getChatMembers();
|
||||
VoiceRecorder.requestAudioRecordingPermission();
|
||||
|
||||
this.deleteRecording();
|
||||
this.loadFiles();
|
||||
}
|
||||
@@ -287,8 +287,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
|
||||
async startRecording() {
|
||||
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})) {
|
||||
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})) {
|
||||
VoiceRecorder.requestAudioRecordingPermission();
|
||||
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
|
||||
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
|
||||
//if(await this.hasAudioRecordingPermission()){
|
||||
if (this.recording) {
|
||||
return;
|
||||
@@ -298,11 +299,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.calculateDuration();
|
||||
//}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.toastService._badRequest('Para gravar uma mensagem de voz, permita o acesso do Gabinete Digital ao seu microfone.');
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.toastService._badRequest('Este dispositivo não tem capacidade para gravação de áudio!');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user