Skip to content

Commit

Permalink
fix(@desktop/chat): show message which was sent during group chat cre…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
mprakhov committed Jan 10, 2023
1 parent 5e8f3e6 commit 3994f8b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions ui/app/AppLayouts/Chat/stores/RootStore.qml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ QtObject {
return msg
}

function sendMessage(event, text, replyMessageId, fileUrlsAndSources) {
var chatContentModule = currentChatContentModule()
function sendMessage(chatId, event, text, replyMessageId, fileUrlsAndSources) {
chatCommunitySectionModule.prepareChatContentModuleForChatId(chatId)
const chatContentModule = chatCommunitySectionModule.getChatContentModule()
if (fileUrlsAndSources.length > 0){
chatContentModule.inputAreaModule.sendImages(JSON.stringify(fileUrlsAndSources));
}
Expand Down
3 changes: 2 additions & 1 deletion ui/app/AppLayouts/Chat/views/ChatColumnView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ Item {
else if (root.rootStore.createChatInitMessage !== "" ||
root.rootStore.createChatFileUrls.length > 0) {

root.rootStore.sendMessage(Qt.Key_Enter,
root.rootStore.sendMessage(chatId,
Qt.Key_Enter,
root.rootStore.createChatInitMessage,
"",
root.rootStore.createChatFileUrls
Expand Down
3 changes: 2 additions & 1 deletion ui/app/AppLayouts/Chat/views/ChatContentView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ ColumnLayout {
return
}

if(root.rootStore.sendMessage(event,
if(root.rootStore.sendMessage(chatContentModule.getMyChatId(),
event,
chatInput.getTextWithPublicKeys(),
chatInput.isReply? chatInput.replyMessageId : "",
chatInput.fileUrlsAndSources
Expand Down
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Chat/views/CreateChatView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Page {

function createChat() {
root.rootStore.createChatInitMessage = chatInput.textInput.text
root.rootStore.createChatFileUrls = chatInput.fileUrls
root.rootStore.createChatFileUrls = chatInput.fileUrlsAndSources
membersSelector.createChat()

membersSelector.cleanup()
Expand Down

0 comments on commit 3994f8b

Please sign in to comment.