feat: Update AI model, remove contribution documentation, and enhance DM channel naming and message data in the chat store.
This commit is contained in:
@@ -313,11 +313,17 @@ export const useChatStore = defineStore('chat', () => {
|
||||
const [addr1, addr2] = [walletAddress.value, targetWallet].sort();
|
||||
const dmChannelId = `dm:${addr1}:${addr2}`;
|
||||
|
||||
// Find the other user's name
|
||||
const otherUser = users.value.find(u => u.wallet_address === targetWallet);
|
||||
const otherName = otherUser?.username || targetWallet.slice(0, 6) + '...';
|
||||
|
||||
// Add to channels list if not exists
|
||||
if (!channels.value.find(c => c.id === dmChannelId)) {
|
||||
channels.value.push({
|
||||
id: dmChannelId,
|
||||
name: `DM: ${targetWallet.slice(0, 4)}...`
|
||||
name: otherName,
|
||||
isDM: true,
|
||||
targetWallet
|
||||
});
|
||||
}
|
||||
|
||||
@@ -351,7 +357,9 @@ export const useChatStore = defineStore('chat', () => {
|
||||
// Map snake_case to camelCase and set status
|
||||
messages.value[channelId] = data.map(m => ({
|
||||
...m,
|
||||
walletAddress: m.wallet_address,
|
||||
txId: m.tx_id,
|
||||
channelId: m.channel_id,
|
||||
status: 'validated' // Messages from DB are confirmed
|
||||
}));
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user