convert message to satisfy FileModel type
This commit is contained in:
@@ -175,7 +175,7 @@ export default class ChatMessageViewModel {
|
||||
|
||||
sendReaction = (content: ReactionSymbols, isDeleting: boolean): void => {
|
||||
this.messagePageViewModel.sendReaction(
|
||||
this.chatMessage.id,
|
||||
this.chatMessage.fileId,
|
||||
content,
|
||||
isDeleting,
|
||||
);
|
||||
@@ -194,7 +194,7 @@ export default class ChatMessageViewModel {
|
||||
this.messagePageViewModel.chatMessageViewModels.value.get(
|
||||
this.chatMessage.inlineReplyId,
|
||||
);
|
||||
this.inlineReply?.replies.set(this.chatMessage.id, this);
|
||||
this.inlineReply?.replies.set(this.chatMessage.fileId, this);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export default class NotificationViewModel {
|
||||
|
||||
// main
|
||||
showNotification = (message: ChatMessage): void => {
|
||||
if (this.seenMessageIds.has(message.id)) return;
|
||||
if (this.seenMessageIds.has(message.fileId)) return;
|
||||
if (this.chatListViewModel.selectedChat.value == undefined) return;
|
||||
|
||||
const notification: Notification = this.createNotification(message);
|
||||
@@ -84,7 +84,7 @@ export default class NotificationViewModel {
|
||||
const fullChannel = ChatModel.splitChannel(message.channel)[0];
|
||||
const chat = this.chatListViewModel.getDisplayName(fullChannel);
|
||||
return {
|
||||
messageId: message.id,
|
||||
messageId: message.fileId,
|
||||
chat,
|
||||
fullChannel,
|
||||
sender: message.senderName,
|
||||
|
||||
@@ -59,7 +59,7 @@ export default class MessagePageViewModel extends Context {
|
||||
sendMessageFromBody = (body: string): Promise<string | false> => {
|
||||
let replyId: string | undefined = undefined;
|
||||
if (this.replyingMessage.value) {
|
||||
replyId = this.replyingMessage.value.chatMessage.id;
|
||||
replyId = this.replyingMessage.value.chatMessage.fileId;
|
||||
}
|
||||
const id = this.chatViewModel.chatModel.sendMessage(body, replyId);
|
||||
|
||||
@@ -118,13 +118,13 @@ export default class MessagePageViewModel extends Context {
|
||||
);
|
||||
|
||||
const existingChatMessageViewModel: ChatMessageViewModel | undefined =
|
||||
this.chatMessageViewModels.value.get(chatMessage.id);
|
||||
this.chatMessageViewModels.value.get(chatMessage.fileId);
|
||||
if (existingChatMessageViewModel != undefined) {
|
||||
existingChatMessageViewModel.body.value = chatMessage.body;
|
||||
existingChatMessageViewModel.status.value = chatMessage.status;
|
||||
} else {
|
||||
this.chatMessageViewModels.set(
|
||||
chatMessage.id,
|
||||
chatMessage.fileId,
|
||||
chatMessageViewModel,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user