mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-01 15:46:40 +07:00
fixed node loading hook
This commit is contained in:
parent
4c4461ea19
commit
0dc5ae99a3
7 changed files with 35 additions and 16 deletions
|
@ -6,13 +6,16 @@ export const useInputPasteUpload = (
|
|||
input: HTMLTextAreaElement | HTMLInputElement | undefined,
|
||||
onUpload: (files: File[]) => void
|
||||
) => {
|
||||
const onPaste = useCallback(async event => {
|
||||
const image = await getImageFromPaste(event);
|
||||
const onPaste = useCallback(
|
||||
async event => {
|
||||
const image = await getImageFromPaste(event);
|
||||
|
||||
if (!image) return;
|
||||
if (!image) return;
|
||||
|
||||
onUpload([image]);
|
||||
}, [onUpload]);
|
||||
onUpload([image]);
|
||||
},
|
||||
[onUpload]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!input) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue