From 9569f849e7ee80eda91d82b9898db62dcff0a455 Mon Sep 17 00:00:00 2001 From: Patrick Mulligan Date: Mon, 16 Feb 2026 17:05:14 -0500 Subject: [PATCH] fix(machine): track relay connection state for live status badge Listen for nostrClient disconnect/connect events to update the connection status badge. Previously it was set once on init and never reflected WebSocket disconnections. Co-Authored-By: Claude Opus 4.6 --- apps/machine/src/stores/atm.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/machine/src/stores/atm.ts b/apps/machine/src/stores/atm.ts index ac4e606..d4ad1dc 100644 --- a/apps/machine/src/stores/atm.ts +++ b/apps/machine/src/stores/atm.ts @@ -180,6 +180,16 @@ export const useAtmStore = defineStore('atm', () => { connectionStatus.value = 'connected' console.log('[ATM] Connected to Lightning.Pub!') + // Track relay connection state + services.nostrClient.on('disconnect', () => { + connectionStatus.value = 'connecting' + console.log('[ATM] Relay disconnected, reconnecting...') + }) + services.nostrClient.on('connect', () => { + connectionStatus.value = 'connected' + console.log('[ATM] Relay reconnected') + }) + // Store references to clients for direct operations lightningPub.value = services.lightningPub clinkClient.value = services.clink