clear display of "interrupted" text with search
Massimo Melina committed
Jan 2, 2022 at 13:41 UTC
63c2c80123c4440ce79405cec55b3b39e256e02f
3 files changed
+6
-4
frontend/src/Head.ts
+2
-2
@@ -19,7 +19,7 @@ export function Head() {
19
}
20
21
function MenuPanel() {
22
- const { remoteSearch, stopSearch, listFilter } = useSnapState()
22
+ const { remoteSearch, stopSearch, stoppedSearch, listFilter } = useSnapState()
23
const [showFilter, setShowFilter] = useState(listFilter > '')
24
const [filter, setFilter] = useState(listFilter)
25
;[state.listFilter] = useDebounce(showFilter ? filter : '', 300)
@@ -73,7 +73,7 @@ function MenuPanel() {
73
}
74
})
75
),
76
- remoteSearch && h('div', { id: 'searched' }, (stopSearch ? 'Searching' : 'Searched') + ': ' + remoteSearch),
76
+ remoteSearch && h('div', { id: 'searched' }, (stopSearch ? 'Searching' : 'Searched') + ': ' + remoteSearch + prefix(' (',stoppedSearch && 'interrupted',')')),
77
showFilter && h('input',{
78
id: 'filter',
79
placeholder: 'Filter',
frontend/src/misc.ts
+1
-1
@@ -34,7 +34,7 @@ export function round(v: number, decimals: number = 0) {
34
return Math.round(v * decimals) / decimals
35
} // round
36
37
-export function prefix(pre:string, v:string|number, post:string='') {
37
+export function prefix(pre:string, v:string|number|undefined|null|false, post:string='') {
38
return v ? pre+v+post : ''
39
}
40
todo.md
+3
-1
@@ -3,7 +3,9 @@
3
- file sorting
4
- folders before?
5
- upload
6
-- log file
6
+- get config values from command line
7
+- accounts path in config
8
+- search dialog to add to history
9
- node.comment
10
- config: max speed (total/per-ip)
11
- config: max connections (total/per-ip)