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 <noreply@anthropic.com>
This commit is contained in:
parent
e6e77f808e
commit
9569f849e7
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue