mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
receive error when sending message on offline
This commit is contained in:
@@ -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 = ''
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user