mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-01-22 19:06:12 +00:00
Fix lost rewind functionality
This commit is contained in:
parent
6bc873ebf1
commit
fdc80a10de
@ -45,10 +45,9 @@ export function useChatHistory() {
|
||||
getMessages(db, mixedId)
|
||||
.then((storedMessages) => {
|
||||
if (storedMessages && storedMessages.messages.length > 0) {
|
||||
const rewindId = searchParams.get('rewindId');
|
||||
const rewindId = searchParams.get('rewindTo');
|
||||
const filteredMessages = rewindId
|
||||
? storedMessages.messages.slice(0,
|
||||
storedMessages.messages.findIndex(m => m.id === rewindId) + 1)
|
||||
? storedMessages.messages.slice(0, storedMessages.messages.findIndex((m) => m.id === rewindId) + 1)
|
||||
: storedMessages.messages;
|
||||
|
||||
setInitialMessages(filteredMessages);
|
||||
|
Loading…
Reference in New Issue
Block a user