enhance: optimize search a bit

This commit is contained in:
Tienson Qin
2021-04-03 21:59:58 +08:00
parent 2fdfd0dcb1
commit e328f15466
2 changed files with 13 additions and 4 deletions

View File

@@ -244,7 +244,15 @@
search-q (state/sub :search/q)
show-result? (boolean (seq search-result))
blocks-count (or (db/blocks-count) 0)
timeout (if (> blocks-count 2000) 500 300)]
timeout (cond
(util/electron?)
150
(> blocks-count 2000)
500
:else
300)]
(rum/with-context [[t] i18n/*tongue-context*]
[:div#search.flex-1.flex
[:div.inner