fix(@desktop/edit) : clicking up arrow opens edit view for a message with image (#12680)
Co-authored-by: kounkou <jacques@status.im>
This commit is contained in:
parent
97da863d70
commit
b0e2651ad8
|
@ -122,9 +122,12 @@ QtObject:
|
|||
proc jumpToMessage*(self: View, messageId: string) {.slot.} =
|
||||
self.delegate.scrollToMessage(messageId)
|
||||
|
||||
proc isEditAllowed(messageImage: string, sticker: string): bool =
|
||||
return messageImage == "" and sticker == ""
|
||||
|
||||
proc setEditModeOnAndScrollToLastMessage*(self: View, pubkey: string) {.slot.} =
|
||||
let lastMessage = self.model.getLastItemFrom(pubKey)
|
||||
if lastMessage != nil and lastMessage.id != "":
|
||||
if lastMessage != nil and lastMessage.id != "" and isEditAllowed(lastMessage.messageImage, lastMessage.sticker):
|
||||
self.model.setEditModeOn(lastMessage.id)
|
||||
self.jumpToMessage(lastMessage.id)
|
||||
|
||||
|
|
Loading…
Reference in New Issue