mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 08:27:04 +00:00
fix: preserve relay order from event instead of sorting by bytes
Remove the sortedBy(receivedBytes) from relayListBuilder and Nip65RelayListViewModel.clear() so relays keep their order as stored in the Nostr event. This makes drag-and-drop reordering meaningful since the saved order is now preserved on reload. https://claude.ai/code/session_01RVM5kEJGrCaJTaP3GmVHDd
This commit is contained in:
-2
@@ -132,8 +132,6 @@ abstract class BasicRelaySetupInfoModel : ViewModel() {
|
||||
.useTor(it),
|
||||
)
|
||||
}.distinctBy { it.relay }
|
||||
.sortedBy { it.relayStat.receivedBytes }
|
||||
.reversed()
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
|
||||
-4
@@ -176,8 +176,6 @@ class Nip65RelayListViewModel : ViewModel() {
|
||||
relayList
|
||||
.map { relaySetupInfoBuilder(it) }
|
||||
.distinctBy { it.relay }
|
||||
.sortedBy { it.relayStat.receivedBytes }
|
||||
.reversed()
|
||||
}
|
||||
|
||||
_notificationRelays.update {
|
||||
@@ -186,8 +184,6 @@ class Nip65RelayListViewModel : ViewModel() {
|
||||
relayList
|
||||
.map { relaySetupInfoBuilder(it) }
|
||||
.distinctBy { it.relay }
|
||||
.sortedBy { it.relayStat.receivedBytes }
|
||||
.reversed()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user