diff --git a/src/app/chat/views/channel.nim b/src/app/chat/views/channel.nim index fc8d2d9813..d03fd2af70 100644 --- a/src/app/chat/views/channel.nim +++ b/src/app/chat/views/channel.nim @@ -294,3 +294,7 @@ QtObject: chatItemView.setChatItem(chat) self.chatItemViews[id] = chatItemView return chatItemView + + proc removeChat*(self: ChannelView, chatId: string) = + discard self.chats.removeChatItemFromList(chatId) + self.setActiveChannel(backToFirstChat) diff --git a/src/status/chat.nim b/src/status/chat.nim index 889c44c675..9359008c7a 100644 --- a/src/status/chat.nim +++ b/src/status/chat.nim @@ -219,7 +219,6 @@ proc leave*(self: ChatModel, chatId: string) = self.channels.del(chatId) discard status_chat.clearChatHistory(chatId) self.events.emit("channelLeft", ChatIdArg(chatId: chatId)) - self.events.emit("activeChannelChanged", ChatIdArg(chatId: backToFirstChat)) proc clearHistory*(self: ChatModel, chatId: string) = discard status_chat.clearChatHistory(chatId) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml index 80ab8a2527..0cd6442840 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml @@ -118,16 +118,16 @@ SplitView { radius: 16 } onClicked: { - svRoot.newMessages = 0 + newMessages = 0 scrollDownButton.visible = false chatLogView.scrollToBottom(true) } StyledText { id: nbMessages - visible: svRoot.newMessages > 0 + visible: newMessages > 0 width: visible ? implicitWidth : 0 - text: svRoot.newMessages + text: newMessages anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left color: Style.current.pillButtonTextColor @@ -202,7 +202,7 @@ SplitView { onNewMessagePushed: { if (!chatLogView.scrollToBottom()) { - svRoot.newMessages++ + newMessages++ } } diff --git a/ui/app/AppLayouts/Chat/ChatColumn/Message.qml b/ui/app/AppLayouts/Chat/ChatColumn/Message.qml index 5d96a80a8e..091a2a0a33 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/Message.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/Message.qml @@ -309,7 +309,8 @@ Item { } return gapNowAndOldest < maxGapInSeconds && gapNowAndJoined > maxGapInSeconds - && (chatsModel.channelView.activeChannel.chatType !== Constants.chatTypePrivateGroupChat || chatsModel.channelView.activeChannel.isMember) + && (chatsModel.channelView.activeChannel.chatType !== Constants.chatTypePrivateGroupChat + || chatsModel.channelView.activeChannel.isMember) } height: childrenRect.height + Style.current.smallPadding * 2 anchors.left: parent.left