fix: 打開不同對話時, 使用了同一個 ChatFragment

* 並修復了使用 key 時, 因爲卸載組件后 ref 丟失導致的錯誤
This commit is contained in:
CrescentLeaf
2025-09-25 16:26:46 +08:00
parent 4b93e5fd67
commit a928577f2a
3 changed files with 4 additions and 2 deletions

View File

@@ -173,7 +173,8 @@ export default function App() {
}
{
isShowChatFragment && <ChatFragment
target={currentChatId} />
target={currentChatId}
key={currentChatId} />
}
</div>
</div>