diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json index 2399c4927..fa2b10805 100644 --- a/android/app/src/main/assets/capacitor.config.json +++ b/android/app/src/main/assets/capacitor.config.json @@ -16,5 +16,8 @@ "sound" ] } + }, + "server": { + "url": "http://192.168.0.60:8100" } } diff --git a/package.json b/package.json index c88ac0fc2..0ab3c3b17 100644 --- a/package.json +++ b/package.json @@ -133,6 +133,7 @@ "g": "^2.0.1", "global": "^4.4.0", "hammerjs": "^2.0.8", + "howler": "^2.2.3", "http-server": "^14.1.1", "i": "^0.3.7", "ionic-angular": "^3.9.10", diff --git a/src/app/pages/chat/group-messages/group-messages.page.ts b/src/app/pages/chat/group-messages/group-messages.page.ts index 5098fc243..fd96b8a75 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.ts +++ b/src/app/pages/chat/group-messages/group-messages.page.ts @@ -83,6 +83,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { showAvatar = true; audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null sessionStore = SessionStore + isAdmin = false; constructor( private modalController: ModalController, public popoverController: PopoverController, @@ -364,7 +365,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { } catch (err) { } } - getRoomInfo() { + async getRoomInfo() { this.showLoader = true; // this.chatService.getRoomInfo(this.roomId).subscribe(room => { // this.room = room['room']; @@ -375,6 +376,24 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { // this.getGroupContacts(this.room); // this.showLoader = false; // }); + this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({}); + let room = await this.chatService.getRoomInfo(this.roomId).toPromise(); + // console.log('ROOM',room) + this.room = room['room']; + if (this.room.name) { + this.roomName = this.room.name.split('-').join(' '); + } + + + 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; + } } async getChatMembers() { @@ -509,6 +528,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { componentProps: { roomId: this.roomId, members: this.members, + isAdmin: this.isAdmin, }, }); await modal.present();