fix: namespace crypto storage per account, add chat polling, fix notification flow and dark theme issues

This commit is contained in:
2026-02-11 11:21:39 +01:00
parent 53673b4650
commit 227791e8f9
11 changed files with 188 additions and 51 deletions

View File

@@ -5,6 +5,7 @@
import { directus } from './directus.js'
import { cryptoService } from './crypto.js'
import { auth } from './auth.js'
class ConversationsService {
constructor() {
@@ -140,7 +141,8 @@ class ConversationsService {
let text = '[Encrypted]'
try {
text = cryptoService.decrypt(msg.content_encrypted, msg.nonce, otherPublicKey, mySecretKey)
const decrypted = cryptoService.decrypt(msg.content_encrypted, msg.nonce, otherPublicKey, mySecretKey)
text = decrypted || '[Decryption failed]'
} catch (e) {
text = '[Decryption failed]'
}
@@ -203,12 +205,14 @@ class ConversationsService {
return this.getConversation(existing.id)
}
const user = await auth.getUser()
const newConv = await directus.startConversation(
listingId,
myHash,
sellerHash,
myPublicKey,
sellerPublicKey
sellerPublicKey,
user?.id
)
return this.getConversation(newConv.id)