Skip to content

Commit

Permalink
Don't automatically select the first message as it breaks with sorting.
Browse files Browse the repository at this point in the history
  • Loading branch information
cr0wst committed Mar 30, 2024
1 parent 84ced20 commit 23fcfd6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/renderer/src/routes/QueueView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@
const api = window.api
$: sortedMessages = $messages.sort((a, b) => {
if (sortDirection === 'asc') {
return a.timestamp.valueOf() - b.timestamp.valueOf()
}
return b.timestamp.valueOf() - a.timestamp.valueOf()
})
// when the selected queue changes, load the messages
$: if ($selectedQueue) {
api.rabbit.getMessages($selectedQueue.id).then(m => {
messages.set(m || [])
selectedMessage.set(m[0] || null)
selectedMessage.set(null)
})
} else {
messages.set([])
Expand Down Expand Up @@ -59,13 +66,6 @@
sortDirection = sortDirection === 'desc' ? 'asc' : 'desc'
}
$: sortedMessages = $messages.sort((a, b) => {
if (sortDirection === 'asc') {
return a.timestamp.valueOf() - b.timestamp.valueOf()
}
return b.timestamp.valueOf() - a.timestamp.valueOf()
})
function copy(text) {
api.system.copyToClipboard(text)
}
Expand Down

0 comments on commit 23fcfd6

Please sign in to comment.