receive error when sending message on offline

This commit is contained in:
Peter Maquiran
2024-08-07 11:18:41 +01:00
parent 95a6d01aae
commit b0a334c9dd
10 changed files with 132 additions and 51 deletions
+24 -9
View File
@@ -45,6 +45,7 @@ import { UserTypingList } from 'src/app/module/chat/data/data-source/userTyping/
import { ChatServiceService } from 'src/app/module/chat/domain/chat-service.service';
import { EditMessagePage } from 'src/app/modals/edit-message/edit-message.page';
import { tap } from 'rxjs/operators';
import { MessageEntity } from 'src/app/module/chat/domain/entity/message';
const IMAGE_DIR = 'stored-images';
@@ -517,17 +518,31 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
sendMessage() {
const data: MessageInputDTO = {
roomId: this.roomId,
senderId: SessionStore.user.UserId,
message: this.textField,
messageType: 0,
canEdit: false,
oneShot:false,
requireUnlock: false,
// const data: MessageInputDTO = {
// roomId: this.roomId,
// senderId: SessionStore.user.UserId,
// message: this.textField,
// messageType: 0,
// canEdit: false,
// oneShot:false,
// requireUnlock: false,
// }
// this.messageRepositoryService.sendMessage(data)
const message = new MessageEntity();
message.message = this.textField
message.roomId = this.roomId
message.sender = {
userPhoto: '',
wxeMail: SessionStore.user.Email,
wxFullName: SessionStore.user.FullName,
wxUserId: SessionStore.user.UserId
}
this.messageRepositoryService.sendMessage(data)
this.chatServiceService.sendMessage(message)
this.textField = ''
}