Handle reply keybind when multiple events selected

This commit is contained in:
miruka 2020-05-20 06:58:38 -04:00
parent d1d7bffc8f
commit 26074fabd5

View File

@ -101,7 +101,11 @@ Rectangle {
onActivated: { onActivated: {
let event = eventList.model.get(0) let event = eventList.model.get(0)
if (eventList.currentIndex === -1) { if (eventList.currentIndex !== -1) {
event = eventList.model.get(eventList.currentIndex)
} else if (eventList.selectedCount) {
event = eventList.getSortedChecked.slice(-1)[0]
} else {
// Find most recent event that wasn't sent by us // Find most recent event that wasn't sent by us
for (let i = 0; i < eventList.model.count; i++) { for (let i = 0; i < eventList.model.count; i++) {
const potentialEvent = eventList.model.get(i) const potentialEvent = eventList.model.get(i)
@ -111,8 +115,6 @@ Rectangle {
break break
} }
} }
} else {
event = eventList.model.get(eventList.currentIndex)
} }
if (! event) return if (! event) return