refac: chat item key

This commit is contained in:
Timothy Jaeryang Baek 2025-06-05 22:38:46 +04:00
parent 870c23f69d
commit 0b84b22b4e

View File

@ -785,7 +785,7 @@
<div <div
class="ml-3 pl-1 mt-[1px] flex flex-col overflow-y-auto scrollbar-hidden border-s border-gray-100 dark:border-gray-900" class="ml-3 pl-1 mt-[1px] flex flex-col overflow-y-auto scrollbar-hidden border-s border-gray-100 dark:border-gray-900"
> >
{#each $pinnedChats as chat, idx} {#each $pinnedChats as chat, idx (`pinned-chat-${chat?.id ?? idx}`)}
<ChatItem <ChatItem
className="" className=""
id={chat.id} id={chat.id}
@ -831,7 +831,7 @@
<div class=" flex-1 flex flex-col overflow-y-auto scrollbar-hidden"> <div class=" flex-1 flex flex-col overflow-y-auto scrollbar-hidden">
<div class="pt-1.5"> <div class="pt-1.5">
{#if $chats} {#if $chats}
{#each $chats as chat, idx} {#each $chats as chat, idx (`chat-${chat?.id ?? idx}`)}
{#if idx === 0 || (idx > 0 && chat.time_range !== $chats[idx - 1].time_range)} {#if idx === 0 || (idx > 0 && chat.time_range !== $chats[idx - 1].time_range)}
<div <div
class="w-full pl-2.5 text-xs text-gray-500 dark:text-gray-500 font-medium {idx === class="w-full pl-2.5 text-xs text-gray-500 dark:text-gray-500 font-medium {idx ===