fix: namespace crypto storage per account, add chat polling, fix notification flow and dark theme issues
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user