This commit is contained in:
Peter Maquiran
2024-10-08 13:16:01 +01:00
parent 0dd4fd665b
commit 9c8ecc182f
22 changed files with 121 additions and 60 deletions
+3
View File
@@ -51,6 +51,9 @@ const routes: Routes = [
{
path: 'edit-message',
loadChildren: () => import('./modal/edit-message/edit-message.module').then( m => m.EditMessagePageModule)
}, {
path: 'chat-popover',
loadChildren: () => import('./modal/chat-popover/chat-popover.module').then( m => m.ChatPopoverPageModule)
}
];
@@ -42,7 +42,7 @@
<ion-checkbox disabled checked color="primary"></ion-checkbox>
<p class="ma-0">{{user.wxFullName }}</p>
<ion-icon name="ellipse"></ion-icon>
<button (click)="deleteMember(user)" class="btn-no-color detele-item-icon">
<button (click)="deleteMember(user)" *ngIf="SessionStore.user.UserId != user.wxUserId" class="btn-no-color detele-item-icon">
<ion-icon color="danger" name="close"></ion-icon>
</button>
</div>
@@ -7,7 +7,7 @@
<!-- <button (click)="ChatMessageDebuggingPage()">Dev</button> -->
<span *ngIf="roomStatus$ | async as roomStatus"><ion-icon *ngIf="roomStatus" class="online" name="ellipse"></ion-icon></span>
</div>
<div class="right" *ngIf="roomType == RoomTypeEnum.Group">
<div class="right" >
<button title="Menu" class="btn-no-color" (click)="_openMessagesOptions()" >
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg">
@@ -209,6 +209,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
if(this.room.local == IDBoolean.true) {
this.messageOnSetRoomId = this.chatServiceService.roomDirectOnSetId({$roomId: this.room.$id}).subscribe((data) => {
this.messageOnSetRoomId?.unsubscribe()
this.room = new RoomViewModel(data)
@@ -223,7 +224,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
setTimeout(() => {
this.subscribeToChanges()
}, 500);
}, 500)
})
}
@@ -827,21 +829,21 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
async messageResult(result: Promise<Result<MessageOutPutDataDTO, any>> ) {
let message = await result
// let message = await result
if(message.isOk() && this.room.local == IDBoolean.true) {
this.room.local = IDBoolean.false;
// if(message.isOk() && this.room.local == IDBoolean.true) {
// this.room.local = IDBoolean.false;
console.log('enter')
await this.chatServiceService.roomSetLocalToFalseById({
$roomId: this.room.$id,
roomId: message.value.roomId
})
// console.log('enter')
// // await this.chatServiceService.roomSetLocalToFalseById({
// // $roomId: this.room.$id,
// // roomId: message.value.roomId
// // })
this.room.id = message.value.roomId
this.subscribeToChanges()
}
// this.room.id = message.value.roomId
// //this.subscribeToChanges()
// }
}
async sendAudio(fileName) {
@@ -1007,7 +1009,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
componentProps: {
roomId: this.room.id,
members: [],
isAdmin: true,
isAdmin: this.isAdmin,
roomType: this.roomType
}
});
@@ -3,7 +3,7 @@
<ion-toolbar>
<ion-title class="title" *ngIf="roomData$ | async as roomData"> {{ roomData.roomName }}</ion-title>
</ion-toolbar>
<div class="btn-close d-flex cursor-pointer pr-20 align-center" >
<div class="btn-close d-flex cursor-pointer pr-20 align-center" (click)="close()" >
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon font-30-em"
src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon font-30-em"
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { NavParams } from '@ionic/angular';
import { ModalController, NavParams } from '@ionic/angular';
import { Observable } from 'rxjs';
import { MemberListLocalRepository } from 'src/app/module/chat/data/repository/member/member-list-local-repository.service'
import { RoomLocalRepository } from 'src/app/module/chat/data/repository/room/room-local-repository.service'
@@ -27,6 +27,7 @@ export class RoomInfoPage implements OnInit {
private RoomLocalRepository: RoomLocalRepository,
private ChatServiceService: ChatServiceService,
public ThemeService: ThemeService,
private modalController: ModalController,
) {
this.roomId = this.navParams.get('roomId');
}
@@ -55,4 +56,8 @@ export class RoomInfoPage implements OnInit {
this.roomData$ = this.RoomLocalRepository.getRoomByIdLive(this.roomId)
}
close() {
this.modalController.dismiss();
}
}
+11 -11
View File
@@ -416,21 +416,21 @@ export class RoomStore {
}
async messageResult(result: Promise<Result<MessageOutPutDataDTO, any>> ) {
let message = await result
// let message = await result
if(message.isOk() && this.room.local == IDBoolean.true) {
this.room.local = IDBoolean.false;
// if(message.isOk() && this.room.local == IDBoolean.true) {
// this.room.local = IDBoolean.false;
console.log('enter')
await this.chatServiceService.roomSetLocalToFalseById({
$roomId: this.room.$id,
roomId: message.value.roomId
})
// console.log('enter')
// await this.chatServiceService.roomSetLocalToFalseById({
// $roomId: this.room.$id,
// roomId: message.value.roomId
// })
this.room.id = message.value.roomId
this.subscribeToChanges()
}
// this.room.id = message.value.roomId
// this.subscribeToChanges()
// }
}