fix(ChatColumnView): hide input when no active chat (#11107)
This commit is contained in:
parent
d534bf6773
commit
407179cd10
|
@ -239,8 +239,10 @@ Item {
|
|||
id: chatInput
|
||||
|
||||
Layout.fillWidth: true
|
||||
visible: !!d.activeChatContentModule
|
||||
|
||||
enabled: !d.activeChatContentModule.chatDetails.blocked
|
||||
enabled: !!d.activeChatContentModule
|
||||
&& !d.activeChatContentModule.chatDetails.blocked
|
||||
&& root.rootStore.sectionDetails.joined
|
||||
&& !root.rootStore.sectionDetails.amIBanned
|
||||
&& root.rootStore.isUserAllowedToSendMessage
|
||||
|
@ -249,6 +251,8 @@ Item {
|
|||
usersStore: d.activeUsersStore
|
||||
|
||||
textInput.placeholderText: {
|
||||
if (!d.activeChatContentModule)
|
||||
return
|
||||
if (d.activeChatContentModule.chatDetails.blocked)
|
||||
return qsTr("This user has been blocked.")
|
||||
if (!root.rootStore.sectionDetails.joined || root.rootStore.sectionDetails.amIBanned)
|
||||
|
@ -262,14 +266,17 @@ Item {
|
|||
suggestions.suggestionFilter.addSystemSuggestions: chatType === Constants.chatType.communityChat
|
||||
|
||||
textInput.onTextChanged: {
|
||||
if (!!d.activeChatContentModule)
|
||||
d.activeChatContentModule.inputAreaModule.preservedProperties.text = textInput.text
|
||||
}
|
||||
|
||||
onReplyMessageIdChanged: {
|
||||
if (!!d.activeChatContentModule)
|
||||
d.activeChatContentModule.inputAreaModule.preservedProperties.replyMessageId = replyMessageId
|
||||
}
|
||||
|
||||
onFileUrlsAndSourcesChanged: {
|
||||
if (!!d.activeChatContentModule)
|
||||
d.activeChatContentModule.inputAreaModule.preservedProperties.fileUrlsAndSourcesJson = JSON.stringify(chatInput.fileUrlsAndSources)
|
||||
}
|
||||
|
||||
|
@ -291,6 +298,7 @@ Item {
|
|||
}
|
||||
|
||||
onStickerSelected: {
|
||||
if (!!d.activeChatContentModule)
|
||||
root.rootStore.sendSticker(d.activeChatContentModule.getMyChatId(),
|
||||
hashId,
|
||||
chatInput.isReply ? chatInput.replyMessageId : "",
|
||||
|
@ -320,10 +328,6 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
onUnblockChat: {
|
||||
|
||||
}
|
||||
|
||||
onKeyUpPress: {
|
||||
d.activeMessagesStore.setEditModeOnLastMessage(root.rootStore.userProfileInst.pubKey)
|
||||
}
|
||||
|
@ -333,10 +337,11 @@ Item {
|
|||
Layout.fillHeight: true
|
||||
Layout.maximumHeight: chatInput.implicitHeight
|
||||
verticalPadding: 0
|
||||
visible: d.activeChatContentModule.chatDetails.blocked
|
||||
visible: !!d.activeChatContentModule && d.activeChatContentModule.chatDetails.blocked
|
||||
text: qsTr("Unblock")
|
||||
type: StatusBaseButton.Type.Danger
|
||||
onClicked: {
|
||||
if (!!d.activeChatContentModule)
|
||||
d.activeChatContentModule.unblockChat()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ Rectangle {
|
|||
signal receiveTransactionCommandButtonClicked()
|
||||
signal stickerSelected(string hashId, string packId, string url)
|
||||
signal sendMessage(var event)
|
||||
signal unblockChat()
|
||||
signal keyUpPress()
|
||||
|
||||
property var usersStore
|
||||
|
|
Loading…
Reference in New Issue