mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: history up arrow
This commit is contained in:
parent
2d884ff12d
commit
af077b2c0d
1 changed files with 1 additions and 8 deletions
|
|
@ -7,14 +7,7 @@ export function useInputHistory() {
|
|||
const [historyIdx, setHistoryIdx] = useState<number | null>(null)
|
||||
const historyDraftRef = useRef('')
|
||||
|
||||
const pushHistory = (text: string) => {
|
||||
const trimmed = text.trim()
|
||||
|
||||
if (trimmed && historyRef.current.at(-1) !== trimmed) {
|
||||
historyRef.current.push(trimmed)
|
||||
inputHistory.append(trimmed)
|
||||
}
|
||||
}
|
||||
const pushHistory = (text: string) => inputHistory.append(text)
|
||||
|
||||
return { historyRef, historyIdx, setHistoryIdx, historyDraftRef, pushHistory }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue