mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-10 22:36:24 +00:00
fix(@desktop/profile): Unmuted chat from profile -> notification
fixes #2557
This commit is contained in:
parent
f755ba44e2
commit
869ae63518
@ -270,20 +270,6 @@ QtObject:
|
||||
self.status.chat.muteChat(selectedChannel)
|
||||
self.updateChannelInRightList(selectedChannel)
|
||||
|
||||
# TODO(pascal): replace with `unmuteChatItem`, which is id based
|
||||
# instead of index based, when refactoring/removing `ChannelContextMenu`
|
||||
# (they still make use of this)
|
||||
proc unmuteChannel*(self: ChannelView, channelIndex: int) {.slot.} =
|
||||
if (self.chats.chats.len == 0): return
|
||||
let selectedChannel = self.getChannel(channelIndex)
|
||||
if (selectedChannel == nil): return
|
||||
if (selectedChannel.id == self.activeChannel.id):
|
||||
self.unmuteCurrentChannel()
|
||||
return
|
||||
selectedChannel.muted = false
|
||||
self.status.chat.unmuteChat(selectedChannel)
|
||||
self.updateChannelInRightList(selectedChannel)
|
||||
|
||||
proc unmuteChatItem*(self: ChannelView, id: string) {.slot.} =
|
||||
if (self.chats.chats.len == 0): return
|
||||
let selectedChannel = self.getChannelById(id)
|
||||
|
@ -53,23 +53,6 @@ QtObject:
|
||||
read = getMutedContactsList
|
||||
notify = mutedContactsListChanged
|
||||
|
||||
proc unmuteChannel*(self: MutedChatsView, chatId: string) {.slot.} =
|
||||
echo "A"
|
||||
if (self.mutedChats.chats.len == 0 and self.mutedContacts.chats.len == 0): return
|
||||
echo "B"
|
||||
var selectedChannel = self.mutedChats.getChannelById(chatId)
|
||||
if (selectedChannel != nil):
|
||||
discard self.mutedChats.removeChatItemFromList(chatId)
|
||||
else:
|
||||
selectedChannel = self.mutedContacts.getChannelById(chatId)
|
||||
if (selectedChannel == nil): return
|
||||
discard self.mutedContacts.removeChatItemFromList(chatId)
|
||||
echo "C"
|
||||
selectedChannel.muted = false
|
||||
self.status.chat.unmuteChat(selectedChannel)
|
||||
self.mutedChatsListChanged()
|
||||
self.mutedContactsListChanged()
|
||||
|
||||
proc updateChats*(self: MutedChatsView, chats: seq[Chat]) =
|
||||
for chat in chats:
|
||||
if not chat.muted:
|
||||
|
@ -73,9 +73,7 @@ ModalPopup {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
//% "Unmute"
|
||||
text: qsTrId("unmute")
|
||||
onClicked: {
|
||||
profileModel.mutedChats.unmuteChannel(model.id)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
@ -83,6 +81,9 @@ ModalPopup {
|
||||
onEntered: {
|
||||
channelItem.isHovered = true
|
||||
}
|
||||
onClicked: {
|
||||
chatsModel.channelView.unmuteChatItem(model.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user