frontend: renamed Filter to Select
Massimo Melina committed
Feb 15, 2023 at 10:48 UTC
42c4ae42f84048bfec46a98dbef5fb2fae8ac81e
1 file changed
+6
-6
frontend/src/menu.ts
+6
-6
@@ -1,7 +1,7 @@
1
// This file is part of HFS - Copyright 2021-2023, Massimo Melina <a@rejetto.com> - License https://www.gnu.org/licenses/gpl-3.0.txt
2
3
import { state, useSnapState } from './state'
4
-import { createElement as h, useEffect } from 'react'
4
+import { createElement as h, useEffect, useMemo } from 'react'
5
import { alertDialog, confirmDialog, ConfirmOptions, promptDialog } from './dialog'
6
import { hIcon, prefix, useStateMounted } from './misc'
7
import { loginDialog } from './login'
@@ -28,15 +28,15 @@ export function MenuPanel() {
28
setTimeout(() => setStarted1secAgo(true), 1000)
29
}, [stopSearch, setStarted1secAgo])
30
31
- //TODO do something for list > 63KB as it hit the url limit (1kb reserved for the rest for the url)
32
- const list = Object.keys(selected).map(s => s.endsWith('/') ? s.slice(0,-1) : s).join('*')
31
+ // passing files as string in the url should allow 1-2000 items before hitting the url limit of 64KB. Shouldn't be a problem, right?
32
+ const list = useMemo(() => Object.keys(selected).map(s => s.endsWith('/') ? s.slice(0,-1) : s).join('*'), [selected])
33
return h('div', { id: 'menu-panel' },
34
h('div', { id: 'menu-bar' },
35
h(LoginButton),
36
h(MenuButton, {
37
- icon: 'filter',
38
- label: "Filter",
39
- tooltip: "Show only elements matching text you type. Works on list already got from the server. Also enables selection of files, for selective \"Download zip\".",
37
+ icon: 'check',
38
+ label: "Select",
39
+ tooltip: `Selection applies to "Download zip", but you can also filter the list`,
40
toggled: showFilter,
41
onClick() {
42
state.showFilter = !showFilter