This commit is contained in:
tiago.kayaya
2021-07-28 16:27:48 +01:00
19 changed files with 352 additions and 173 deletions
@@ -15,6 +15,7 @@ import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { ToastService } from 'src/app/services/toast.service';
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
import { Location } from '@angular/common'
@Component({
selector: 'app-view-event',
@@ -58,6 +59,7 @@ export class ViewEventPage implements OnInit {
private activatedRoute: ActivatedRoute,
private router: Router,
private toastService: ToastService,
private location: Location
)
{
this.isEventEdited = false;
@@ -109,14 +111,16 @@ export class ViewEventPage implements OnInit {
if(this.isModal) {
this.close()
} else {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].caller == 'expediente'){
window.history.back();
}
else{
this.router.navigate(['/home',params["params"].caller]);
}
});
// this.activatedRoute.paramMap.subscribe(params => {
// if(params["params"].caller == 'expediente'){
// window.history.back();
// }
// else{
// this.router.navigate(['/home',params["params"].caller]);
// }
// });
this.location.back();
}
}
@@ -128,13 +132,17 @@ export class ViewEventPage implements OnInit {
/* this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove()
}, ()=>{
}, (error)=>{
loader.remove()
this.toastService.badRequest('Este evento já não existe na sua agenda')
this.modalController.dismiss('Eevent not Foud');
this.router.navigate(['/home/agenda']);
if(error.status == 0) {
this.toastService.badRequest('não é possível vizualizar este event no modo offline')
} else {
this.toastService.badRequest('Este evento já não existe na sua agenda')
}
loader.remove()
this.modalController.dismiss('Eevent not Foud');
this.location.back();
});
}