diff --git a/neode-ui/src/views/web5/Web5ConnectedNodes.vue b/neode-ui/src/views/web5/Web5ConnectedNodes.vue
index b376a3e0..9d4db73d 100644
--- a/neode-ui/src/views/web5/Web5ConnectedNodes.vue
+++ b/neode-ui/src/views/web5/Web5ConnectedNodes.vue
@@ -11,21 +11,6 @@
{{ t('web5.connectedNodes') }}
-
-
-
-
@@ -174,7 +159,9 @@
-
+
+
-
- {{ discovering ? t('web5.discovering') : t('web5.discoverNodes') }}
-
-
- {{ loadingPeers ? t('common.loading') : t('common.refresh') }}
-
-
- {{ loadingRequests ? t('common.loading') : t('web5.refreshRequests') }}
-
@@ -328,7 +291,6 @@ const observers = ref(cached.observers ?? [])
const loadingPeers = ref(false)
const peerReachableLocal = ref>(cached.peerReachable ?? {})
const peerReachable = computed(() => ({ ...appStore.peerHealth, ...peerReachableLocal.value }))
-const discovering = ref(false)
// Send message modal
const showSendMessageModal = ref(false)
@@ -378,6 +340,12 @@ function switchToRequestsTab() {
}
}
+// The single bottom Refresh acts on whichever tab is open.
+function refreshActiveTab() {
+ if (nodesContainerTab.value === 'requests') void loadConnectionRequests()
+ else void loadPeers()
+}
+
async function loadPeers() {
const hadPeers = peers.value.length > 0 || observers.value.length > 0
loadingPeers.value = true
@@ -456,28 +424,6 @@ async function sendMessage() {
}
}
-async function discoverAndAddPeers() {
- discovering.value = true
- try {
- const res = await rpcClient.discoverNodes()
- const nodes = res.nodes || []
- for (const n of nodes) {
- if (n.onion && n.pubkey) {
- try {
- await rpcClient.addPeer({ onion: n.onion, pubkey: n.pubkey })
- } catch (e) {
- if (import.meta.env.DEV) console.warn('Peer may already exist', e)
- }
- }
- }
- await loadPeers()
- } catch (e) {
- if (import.meta.env.DEV) console.error('Discover failed:', e)
- } finally {
- discovering.value = false
- }
-}
-
async function loadConnectionRequests() {
const hadRequests = connectionRequests.value.length > 0
loadingRequests.value = true