bug refresh init solved

This commit is contained in:
Eudes Inácio
2022-12-21 11:05:05 +01:00
parent 3aff9ff3bc
commit 648ffbe8d9
3 changed files with 12 additions and 51 deletions
+1 -1
View File
@@ -64,7 +64,7 @@
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor="let event of listToPresent"
(click)="goToEvent(event)"
>
<div class="d-flex content-{{loggeduser.Profile}}-{{event.CalendarName}}">
<div class="d-flex content-{{sessoStore.user.Profile}}-{{event.CalendarName}}">
<div class="schedule-time">
<div *ngIf="!event.IsAllDayEvent" class="time-start">{{event.StartDate | date: 'HH:mm'}}</div>
+10 -49
View File
@@ -63,6 +63,7 @@ export class EventsPage implements OnInit {
@Output() openExpedientListPage: EventEmitter<any> = new EventEmitter<any>();
loggeduser: LoginUserRespose;
sessoStore = SessionStore;
constructor(
private eventService: EventsService,
@@ -155,56 +156,16 @@ export class EventsPage implements OnInit {
let month = date.getMonth() + 1;
let start = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
let end = date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59";
if (this.loggeduser.Profile == 'MDGPR') {
let mdOficialEvents = await this.eventService.getAllMdOficialEvents(start, end).toPromise();
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
const list = mdOficialEvents.concat(mdPessoalEvents);
this.addEventToDb(list);
this.listToPresent = list
if (list.length > 0) {
this.currentEvent = list[0].Subject;
this.currentHoursMinutes = list[0].StartDate;
}
this.totalEvent = list.length;
this.showLoader = false;
}
else if (this.loggeduser.Profile == 'PR') {
let prOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
let prPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
const list = prOficialEvents.concat(prPessoalEvents);
this.addEventToDb(list);
if (list.length > 0) {
this.currentEvent = list[0].Subject;
this.currentHoursMinutes = list[0].StartDate;
}
this.listToPresent = list;
this.totalEvent = list.length;
this.showLoader = false;
} else {
if(this.loggeduser.OwnerCalendars.length >= 1) {
if(SessionStore.user) {
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => {
console.error(error)
})
this.listToPresent = onwEvent;
this.totalEvent = onwEvent.length;
this.showLoader = false;
} else {
}
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => {
console.error(error)
})
this.listToPresent = onwEvent;
this.totalEvent = onwEvent.length;
this.showLoader = false;
} else {
}
}
+1 -1
View File
@@ -143,7 +143,7 @@ export class LoginPage implements OnInit {
} else {
this.sqliteservice.deleteAllTables();
this.RochetChatConnectorService.logout();
this.clearStoreService.clear();
this.ChatSystemService.clearChat();