Fix: Build Errors
This commit is contained in:
parent
a71c715bc3
commit
ab5d2bc88d
1 changed files with 2 additions and 47 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
import { ref, computed, readonly } from 'vue'
|
import { ref, computed, readonly } from 'vue'
|
||||||
|
|
||||||
import { nip04, finalizeEvent, type EventTemplate, generateSecretKey, getPublicKey } from 'nostr-tools'
|
import { nip04, finalizeEvent, type EventTemplate } from 'nostr-tools'
|
||||||
import { hexToBytes, bytesToHex } from '@/lib/utils/crypto'
|
import { hexToBytes } from '@/lib/utils/crypto'
|
||||||
import { getAuthToken } from '@/lib/config/lnbits'
|
import { getAuthToken } from '@/lib/config/lnbits'
|
||||||
import { config } from '@/lib/config'
|
import { config } from '@/lib/config'
|
||||||
import { useRelayHub } from './useRelayHub'
|
import { useRelayHub } from './useRelayHub'
|
||||||
|
|
@ -516,52 +516,7 @@ export function useNostrChat() {
|
||||||
return unsubscribe
|
return unsubscribe
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load historical messages for a peer
|
|
||||||
const loadHistoricalMessages = async (peerPubkey: string, myPubkey: string) => {
|
|
||||||
console.log('Loading historical messages for peer:', peerPubkey)
|
|
||||||
console.log('My pubkey:', myPubkey)
|
|
||||||
|
|
||||||
const relayConfigs = getRelays()
|
|
||||||
console.log('Using relays:', relayConfigs.map(r => r.url))
|
|
||||||
|
|
||||||
const filters = [
|
|
||||||
{
|
|
||||||
kinds: [4],
|
|
||||||
authors: [peerPubkey],
|
|
||||||
'#p': [myPubkey]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
kinds: [4],
|
|
||||||
authors: [myPubkey],
|
|
||||||
'#p': [peerPubkey]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
console.log('Historical query filters:', filters)
|
|
||||||
|
|
||||||
const unsubscribe = relayHub.subscribe({
|
|
||||||
id: `historical-${peerPubkey}-${Date.now()}`,
|
|
||||||
filters,
|
|
||||||
relays: relayConfigs.map(r => r.url),
|
|
||||||
onEvent: (event: any) => {
|
|
||||||
console.log('Received historical event:', {
|
|
||||||
id: event.id,
|
|
||||||
author: event.pubkey,
|
|
||||||
isSentByMe: event.pubkey === myPubkey,
|
|
||||||
contentLength: event.content.length
|
|
||||||
})
|
|
||||||
handleIncomingMessage(event, peerPubkey)
|
|
||||||
},
|
|
||||||
onEose: () => {
|
|
||||||
console.log('Historical query completed for peer:', peerPubkey)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// Wait a bit for historical messages to load
|
|
||||||
await new Promise(resolve => setTimeout(resolve, 3000))
|
|
||||||
unsubscribe()
|
|
||||||
console.log('Historical query closed for peer:', peerPubkey)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle incoming message
|
// Handle incoming message
|
||||||
const handleIncomingMessage = async (event: any, peerPubkey: string) => {
|
const handleIncomingMessage = async (event: any, peerPubkey: string) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue