diff --git a/.env b/.env new file mode 100644 index 0000000..691e8a2 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +# Support agent's public key in npub format +VITE_SUPPORT_NPUB=npub1p9290wv4q4694nwtvgewpraardttt7cljduq2vdwyp0y6n5pczsszet4h7 \ No newline at end of file diff --git a/dev-dist/sw.js b/dev-dist/sw.js index 136c19f..862369c 100644 --- a/dev-dist/sw.js +++ b/dev-dist/sw.js @@ -79,7 +79,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict'; */ workbox.precacheAndRoute([{ "url": "index.html", - "revision": "0.0k43usmfr4" + "revision": "0.2675lqganp8" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/src/components/ChatBox.vue b/src/components/ChatBox.vue deleted file mode 100644 index 792b53c..0000000 --- a/src/components/ChatBox.vue +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - - - - - - SA - - - - Support Agent - - - Online - - - - - - - - Customer Support - - - - - - - - - - - - - - - - - - - - - {{ formatDate(group.timestamp) }} - - - - - - - - - {{ message.content }} - - - {{ formatTime(message.created_at) }} - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/components/SupportChat.vue b/src/components/SupportChat.vue index d9fbda2..285ce67 100644 --- a/src/components/SupportChat.vue +++ b/src/components/SupportChat.vue @@ -1,19 +1,20 @@ @@ -79,7 +149,42 @@ const sendMessage = async (event: Event) => { - + + + + + + {{ formatDate(group.timestamp) }} + + + + + + + + {{ message.content }} + + + {{ formatTime(message.created_at) }} + + + + + + @@ -108,17 +213,26 @@ const sendMessage = async (event: Event) => { \ No newline at end of file diff --git a/src/components/layout/Navbar.vue b/src/components/layout/Navbar.vue index a153354..aed2c85 100644 --- a/src/components/layout/Navbar.vue +++ b/src/components/layout/Navbar.vue @@ -1,12 +1,16 @@ @@ -55,7 +67,7 @@ const toggleLocale = () => { - + @@ -67,6 +79,11 @@ const toggleLocale = () => { {{ locale === 'en' ? '🇪🇸 ES' : '🇺🇸 EN' }} + + + + + Open main menu diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 3e80b93..ff44251 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -4,7 +4,9 @@ export default { home: 'Home', directory: 'Directory', faq: 'FAQ', - support: 'Support' + support: 'Support', + login: 'Login', + logout: 'Logout' }, home: { title: 'Find Bitcoin Lightning Acceptors', diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 6306384..1f78fed 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -4,7 +4,9 @@ export default { home: 'Inicio', directory: 'Directorio', faq: 'Preguntas', - support: 'Soporte' + support: 'Soporte', + login: 'Iniciar Sesión', + logout: 'Cerrar Sesión' }, home: { title: 'Encuentra Aceptadores de Bitcoin Lightning', diff --git a/src/stores/nostr.ts b/src/stores/nostr.ts index 946d261..33bae6d 100644 --- a/src/stores/nostr.ts +++ b/src/stores/nostr.ts @@ -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 } }) \ No newline at end of file
Support Agent
Online