diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index aa03c4cd4..5e11c7fc5 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -242,7 +242,6 @@ >
-
InĂ­cio
Fim
@@ -254,8 +253,17 @@
-
Todo
-
o dia
+ +
Todo
+
o dia
+ + +
Todo
+
o dia
+ +
{{event.event.StartDate | date: 'HH:mm'}}
+
{{event.event.EndDate | date: 'HH:mm'}}
+
diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 471a0e1a6..0be3a9409 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -146,7 +146,6 @@ export class LoginPage implements OnInit { await this.authService.loginToChatWs(); this.ChatService.setheader() - this.ChatSystemService.loadChat(); } @@ -181,7 +180,6 @@ export class LoginPage implements OnInit { if (attempt.ChatData) { await this.authService.loginToChatWs(); this.ChatService.setheader(); - this.ChatSystemService.loadChat(); } this.storageService.remove("Notifications") this.getToken(); diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index 1848c564a..306b947b2 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -20,6 +20,7 @@ import { PublicationVideoManagerService } from "src/app/services/publication/pub import { StopvideoService } from "src/app/services/stopvideo.service" import { Result } from 'neverthrow'; import { App } from '@capacitor/app'; +import { ActiveTabService } from 'src/app/services/active-tab.service'; @Component({ selector: 'app-view-publications', templateUrl: './view-publications.page.html', @@ -69,7 +70,8 @@ export class ViewPublicationsPage implements OnInit { public checkFileType: checkFileTypeService, private publicationVideoManagerService: PublicationVideoManagerService, public stopvideoService: StopvideoService, - private platform: Platform,) { + private platform: Platform, + public activeTabService: ActiveTabService) { /* this.publicationVideoManagerService.setContainer(this.VideoManager.nativeElement) */ @@ -118,6 +120,13 @@ export class ViewPublicationsPage implements OnInit { }) // console.log(this.publicationFolderService.publicationList[this.folderId]) + + setTimeout(()=> { + + this.doRefresh({}) + + }, 1500) + } diff --git a/src/app/services/active-tab.service.ts b/src/app/services/active-tab.service.ts index 3fe770e8f..ec712de96 100644 --- a/src/app/services/active-tab.service.ts +++ b/src/app/services/active-tab.service.ts @@ -16,6 +16,8 @@ export class ActiveTabService { gabineteDetails: false } + updatePublications = () => {} + constructor( private router: Router, public HeaderSettingsService: HeaderSettingsService) { @@ -47,6 +49,13 @@ export class ActiveTabService { } else if (pathName.startsWith('/home/publications')) { this.pages.publication = true + if(pathName.includes("/publications/")) { + if(this.updatePublications) { + this.updatePublications() + } + + } + } else if (pathName.startsWith('/home/chat')) { this.pages.chat = true } diff --git a/src/app/services/agenda/list-box.service.ts b/src/app/services/agenda/list-box.service.ts index 47151f290..192498ec2 100644 --- a/src/app/services/agenda/list-box.service.ts +++ b/src/app/services/agenda/list-box.service.ts @@ -67,8 +67,6 @@ export class ListBoxService { // object[momentG(new Date(e.start), 'MMMM yyyy')].push(e) // } - // console.log({object}) - // const daysStringNum = Object.keys(object).reverse() // const daysObject = {} @@ -77,13 +75,8 @@ export class ListBoxService { // daysObject[day] = object[day] // } - // console.log({daysObject}) - - return this.display(newStracture, selectedDate).year - // console.log({daysObject}) - // const daysStringNum = Object.keys(daysObject) // for(const day of daysStringNum) { @@ -105,6 +98,8 @@ export class ListBoxService { } display(list: CustomCalendarEvent[], selectedDate) { + + let days = {}; const year: Year[] = [] @@ -171,14 +166,14 @@ export class ListBoxService { // last push const EndEvent = this.transForm(cloneEvent, {startMany: false, endMany: true, middle: false}) if(this.CanPush(cloneEvent, selectedDate) && cloneEvent.start.getTime() >= cloneSelectedDate.getTime()) { - days[otherDays].push(EndEvent) ; this.push(cloneEvent, year) + days[otherDays].push(EndEvent) ; this.push(EndEvent, year) } } else { const EndEvent = this.transForm(cloneEvent, {startMany: false,endMany: true, middle: true}) if(this.CanPush(cloneEvent, selectedDate) && cloneEvent.start.getTime() >= cloneSelectedDate.getTime()) { - days[otherDays].push(EndEvent) ; this.push(cloneEvent, year) + days[otherDays].push(EndEvent) ; this.push(EndEvent, year) } } diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index d46be8058..7e382a2f6 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -190,6 +190,7 @@ export class AuthService { SessionStore.user.RochetChatUserId = message.result.id SessionStore.save() + this.ChatSystemService.loadChat() this.RochetChatConnectorService.setStatus('online') window['RochetChatConnectorService'] = this.RochetChatConnectorService setTimeout(() => { @@ -199,7 +200,14 @@ export class AuthService { }).catch((error) => { - // console.error(SessionStore.user.ChatData, 'web socket login',error) + console.error(SessionStore.user.ChatData, 'web socket login', error) + + if(window.location.pathname.includes('/home/')) { + setTimeout(() => { + this.loginToChatWs(); + }, 4000) + } + }) } @@ -333,7 +341,7 @@ export class AuthService { } refreshToken() { - + return this.http .put(environment.apiURL + "UserAuthentication/RefreshToken", { refreshToken: SessionStore.user.RefreshToken, diff --git a/src/app/services/socket-connection-mcr.service.ts b/src/app/services/socket-connection-mcr.service.ts index 0490b2406..3340a6872 100644 --- a/src/app/services/socket-connection-mcr.service.ts +++ b/src/app/services/socket-connection-mcr.service.ts @@ -390,32 +390,32 @@ export class ObjectMergeNotification{ watchCount = 0 constructor() { - this.socket.onDisconnectCallback(()=> { - console.log("run watch") - this.runWatch = true - this.watch() - }) + // this.socket.onDisconnectCallback(()=> { + // console.log("run watch") + // this.runWatch = true + // this.watch() + // }) - this.socket.onConnectCallback(()=> { + // this.socket.onConnectCallback(()=> { - console.log("open trigger") - this.runWatch = false - }) + // console.log("open trigger") + // this.runWatch = false + // }) - this.socket.subscribe((data: socketResponse) => { - if(data.IsCompleted == true) { - console.log("==================!!!====================") - try { - this.callbacks[data.Guid](data) - delete this.callbacks[data.Guid] - } catch (error) {} - } else { - console.log("else", data) - } - }) + // this.socket.subscribe((data: socketResponse) => { + // if(data.IsCompleted == true) { + // console.log("==================!!!====================") + // try { + // this.callbacks[data.Guid](data) + // delete this.callbacks[data.Guid] + // } catch (error) {} + // } else { + // console.log("else", data) + // } + // }) - this.socket.connect(); - this.watch() + // this.socket.connect(); + // this.watch() } connect() { diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index b90b88db4..002fca5f2 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -46,7 +46,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe documents: SearchList[] = []; room: any = new Array(); - roomName: any; members: any; capturedImage: any; @@ -58,8 +57,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe currentPosition: any; startPosition: number; scrollToBottomBtn = false; - roomCountDownDate: string; - roomCountDownTime: string; isAdmin = false; @Input() roomId: string; @@ -112,8 +109,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe this.ChatSystemService.getUser() this.loggedUserChat = SessionStore.user.ChatData['data']; this.isGroupCreated = true; - this.roomCountDownDate = ""; - this.roomCountDownTime = ""; } ngOnChanges(changes: SimpleChanges): void { @@ -151,10 +146,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe return this.timeService.showDateDuration(start); } - countDownDate() { - return this.timeService.countDownDateTimer(this.roomCountDownDate, this.roomId); - } - setStatus(status: string) { let body = { message: '', @@ -377,28 +368,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({}); } - let room = await this.chatService.getRoomInfo(this.roomId).toPromise(); - this.room = room['room']; - if (this.room.name) { - try { - this.roomName = this.room.name.split('-').join(' '); - } catch (error) { - this.roomName = this.room.name; - } - - } - - - if(SessionStore.user.ChatData.data.userId == this.room.u._id){ - this.isAdmin = true - } else { - this.isAdmin = false - } - - if (this.room.customFields.countDownDate) { - this.roomCountDownDate = this.room.customFields.countDownDate; - } - this.getGroupContacts(this.room); } @@ -536,14 +505,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe } else { - if(res?.data?.name) { - try { - this.roomName = res.data.name.split('-').join(' '); - } catch (error) { - this.roomName = res.data.name - - } - } }; diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 1b55290ea..2536052bb 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -4,4 +4,4 @@ import { environment as doneITProd } from './suport/doneIt' import { DevDev } from './suport/dev' -export const environment: Environment = oaprProd; +export const environment: Environment = DevDev;