From 167cb9e63f81760813a82622d66f6bf70d0d71b5 Mon Sep 17 00:00:00 2001 From: MishkaRogachev Date: Wed, 6 Jul 2022 17:16:58 +0300 Subject: [PATCH] Fix(Chat): Reset MessageContextMenuView state on close Close #5289 --- src/app_service/service/contacts/service.nim | 6 ++++-- ui/imports/shared/views/chat/MessageContextMenuView.qml | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app_service/service/contacts/service.nim b/src/app_service/service/contacts/service.nim index d4896801ea..a3495135e4 100644 --- a/src/app_service/service/contacts/service.nim +++ b/src/app_service/service/contacts/service.nim @@ -428,25 +428,27 @@ QtObject: proc unblockContact*(self: Service, publicKey: string) = var contact = self.getContactById(publicKey) - contact.blocked = false let response = status_contacts.unblockContact(contact.id) if(not response.error.isNil): let msg = response.error.message error "error unblocking contact ", msg return + + contact.blocked = false self.saveContact(contact) self.events.emit(SIGNAL_CONTACT_UNBLOCKED, ContactArgs(contactId: contact.id)) proc blockContact*(self: Service, publicKey: string) = var contact = self.getContactById(publicKey) - contact.blocked = true let response = status_contacts.blockContact(contact.id) if(not response.error.isNil): let msg = response.error.message error "error blocking contact ", msg return + + contact.blocked = true self.saveContact(contact) self.events.emit(SIGNAL_CONTACT_BLOCKED, ContactArgs(contactId: contact.id)) diff --git a/ui/imports/shared/views/chat/MessageContextMenuView.qml b/ui/imports/shared/views/chat/MessageContextMenuView.qml index d0a13e3a96..149eecf582 100644 --- a/ui/imports/shared/views/chat/MessageContextMenuView.qml +++ b/ui/imports/shared/views/chat/MessageContextMenuView.qml @@ -97,6 +97,7 @@ StatusPopupMenu { onHeightChanged: { root.y = setYPosition(); } onWidthChanged: { root.x = setXPosition(); } + onClosed: selectedUserPublicKey = "" width: Math.max(emojiContainer.visible ? emojiContainer.width : 0, 200)