From edf5a029eefc1f9784bbe63960767eca2e41df10 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sat, 30 Apr 2022 14:10:29 +0200 Subject: [PATCH] Problem: unread channels are at random positions Solution: move unread channels to the top --- cmd/eksterd/memory.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/eksterd/memory.go b/cmd/eksterd/memory.go index e550a02..2b6d73b 100644 --- a/cmd/eksterd/memory.go +++ b/cmd/eksterd/memory.go @@ -156,6 +156,9 @@ GROUP BY c.id; }}) } + util.StablePartition(channels, 0, len(channels), func(i int) bool { + return channels[i].Unread.HasUnread() + }) return channels, nil }