fix: deduplicate prompt history entries
Avoid adding duplicate entries to prompt history when the same input is appended multiple times (e.g., clearing with ctrl+c then restoring via history navigation and clearing again).
This commit is contained in:
parent
ac5a5d8b16
commit
8805dfc849
1 changed files with 1 additions and 0 deletions
|
|
@ -82,6 +82,7 @@ export const { use: usePromptHistory, provider: PromptHistoryProvider } = create
|
|||
return store.history.at(store.index)
|
||||
},
|
||||
append(item: PromptInfo) {
|
||||
if (store.history.at(-1)?.input === item.input) return
|
||||
const entry = clone(item)
|
||||
let trimmed = false
|
||||
setStore(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue