Refactor chat and market modules for improved integration and maintainability
- Remove deprecated Nostr chat and relay hub components, transitioning to a modular chat service for better encapsulation. - Update App.vue and Navbar.vue to utilize the new chat module, enhancing user experience with automatic peer management. - Simplify event handling and connection logic in ChatComponent.vue, ensuring compatibility with the new chat service architecture. - Adjust market settings and order history components to reflect changes in the chat module, improving overall coherence in the application structure. - Clean up unused imports and streamline configuration access for better performance and maintainability.
This commit is contained in:
parent
63de083909
commit
17c07c37a0
17 changed files with 63 additions and 2222 deletions
|
|
@ -463,14 +463,17 @@ export function useMarket() {
|
|||
// Connect to market
|
||||
const connectToMarket = async () => {
|
||||
try {
|
||||
// Connect to market
|
||||
|
||||
// Connect to relay hub
|
||||
await relayHub.connect()
|
||||
// Use existing relay hub connection (should already be connected by base module)
|
||||
isConnected.value = relayHub.isConnected.value
|
||||
|
||||
if (!isConnected.value) {
|
||||
throw new Error('Failed to connect to Nostr relays')
|
||||
console.warn('RelayHub not connected, attempting to connect...')
|
||||
await relayHub.connect()
|
||||
isConnected.value = relayHub.isConnected.value
|
||||
|
||||
if (!isConnected.value) {
|
||||
throw new Error('Failed to connect to Nostr relays')
|
||||
}
|
||||
}
|
||||
|
||||
// Market connected successfully
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue