mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix(search): make search more stable
This commit is contained in:
parent
f755ad9e71
commit
bb5f745b45
1 changed files with 8 additions and 4 deletions
|
|
@ -137,10 +137,14 @@ const handleKeyDown = dispatch => ({ key }) => dispatch(({ visibleNodes: { nodes
|
|||
}
|
||||
})
|
||||
|
||||
const handleSearchKeyChange = dispatch => async event => {
|
||||
const searchKey = event.target.value
|
||||
await visibleNodesGenerator.search(searchKey)
|
||||
dispatch(updateVisibleNodes)
|
||||
const handleSearchKeyChange = dispatch => {
|
||||
let i = 0
|
||||
return async event => {
|
||||
const searchKey = event.target.value
|
||||
const j = i += 1
|
||||
await visibleNodesGenerator.search(searchKey)
|
||||
if (i === j) dispatch(updateVisibleNodes)
|
||||
}
|
||||
}
|
||||
|
||||
const delayExpandThreshold = 400
|
||||
|
|
|
|||
Loading…
Reference in a new issue