From 4648f568070b15a5c86899700e06fb46977a10f0 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Tue, 30 Apr 2024 23:35:40 +1200 Subject: [PATCH] show peers ordered by most recently announced first --- public/index.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index a149e82..8601345 100644 --- a/public/index.html +++ b/public/index.html @@ -74,7 +74,7 @@
Peers Discovered ({{ Object.keys(peers).length }})
-
+
@@ -556,6 +556,13 @@ isMobile() { return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); }, + peersOrderedByLatestAnnounce() { + const peers = Object.values(this.peers); + return peers.sort(function(peerA, peerB) { + // order by last_announce_timestamp desc + return peerB.last_announce_timestamp - peerA.last_announce_timestamp; + }); + }, selectedPeerChatItems() { // get all chat items related to the selected peer