feat: prevent click when processing
This commit is contained in:
parent
4df7df678b
commit
b0bfb3e606
@ -146,6 +146,9 @@ export const App = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const selectFiles = () => {
|
const selectFiles = () => {
|
||||||
|
if (isProcessing) {
|
||||||
|
return
|
||||||
|
}
|
||||||
SelectFiles().then(files => {
|
SelectFiles().then(files => {
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
setItems(prev => [...prev, { file, status: 'pending' }])
|
setItems(prev => [...prev, { file, status: 'pending' }])
|
||||||
@ -234,7 +237,14 @@ export const App = () => {
|
|||||||
<Button onClick={selectFiles} icon={<DocumentAddRegular />}>
|
<Button onClick={selectFiles} icon={<DocumentAddRegular />}>
|
||||||
添加文件
|
添加文件
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={() => setItems([])} icon={<DeleteDismissRegular />}>
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
if (!isProcessing) {
|
||||||
|
setItems([])
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
icon={<DeleteDismissRegular />}
|
||||||
|
>
|
||||||
清除列表
|
清除列表
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
Loading…
x
Reference in New Issue
Block a user