big milestone 2!!!
This commit is contained in:
parent
ac906ca6c9
commit
231658b980
8 changed files with 167 additions and 297 deletions
|
|
@ -42,12 +42,22 @@ const SUPPORT_NPUB = import.meta.env.VITE_SUPPORT_NPUB
|
|||
|
||||
// Helper functions
|
||||
async function connectToRelay(url: string) {
|
||||
console.log(`Attempting to connect to relay: ${url}`)
|
||||
const relay = window.NostrTools.relayInit(url)
|
||||
try {
|
||||
console.log(`Initializing connection to ${url}...`)
|
||||
await relay.connect()
|
||||
console.log(`Successfully connected to ${url}`)
|
||||
return relay
|
||||
} catch (err) {
|
||||
console.error(`Failed to connect to ${url}:`, err)
|
||||
if (err instanceof Error) {
|
||||
console.error('Error details:', {
|
||||
message: err.message,
|
||||
name: err.name,
|
||||
stack: err.stack
|
||||
})
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
|
@ -320,6 +330,7 @@ export const useNostrStore = defineStore('nostr', () => {
|
|||
init,
|
||||
login,
|
||||
logout,
|
||||
sendMessage
|
||||
sendMessage,
|
||||
subscribeToMessages
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue