bare repo

This commit is contained in:
padreug 2025-03-09 12:28:49 +01:00
parent d73f9bc01e
commit 3d356225cd
31 changed files with 134 additions and 3005 deletions

View file

@ -1,27 +0,0 @@
import { computed } from 'vue'
import { useMessageStore } from '@/stores/messages'
import { useNostrStore } from '@/stores/nostr'
export function useChat(pubkey: string) {
const messageStore = useMessageStore()
const nostrStore = useNostrStore()
const messages = computed(() =>
messageStore.messages.get(pubkey) || []
)
const sendMessage = async (content: string) => {
if (!content.trim()) return
await nostrStore.sendMessage(pubkey, content)
}
const loadHistory = async () => {
await nostrStore.subscribeToMessages()
}
return {
messages,
sendMessage,
loadHistory
}
}