Skip to content

Commit

Permalink
Fix(Chat): Reset MessageContextMenuView state on close
Browse files Browse the repository at this point in the history
Close #5289
  • Loading branch information
MishkaRogachev committed Jul 6, 2022
1 parent 45448db commit 31482d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app_service/service/contacts/service.nim
Original file line number Diff line number Diff line change
Expand Up @@ -365,25 +365,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))

Expand Down
1 change: 1 addition & 0 deletions ui/imports/shared/views/chat/MessageContextMenuView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ StatusPopupMenu {

onHeightChanged: { root.y = setYPosition(); }
onWidthChanged: { root.x = setXPosition(); }
onClosed: selectedUserPublicKey = ""

width: Math.max(emojiContainer.visible ? emojiContainer.width : 0, 200)

Expand Down

0 comments on commit 31482d0

Please sign in to comment.