mirror of
https://github.com/ente-io/ente.git
synced 2025-08-07 23:18:10 +00:00
Attempt to intercept cancellation
This commit is contained in:
parent
ca28a3c595
commit
8618babc11
@ -851,13 +851,33 @@ const Inputs: React.FC<InputsProps> = ({
|
||||
getFileSelectorInputProps,
|
||||
getFolderSelectorInputProps,
|
||||
getZipFileSelectorInputProps,
|
||||
}) => (
|
||||
<>
|
||||
<input {...getFileSelectorInputProps()} />
|
||||
<input {...getFolderSelectorInputProps()} />
|
||||
<input {...getZipFileSelectorInputProps()} />
|
||||
</>
|
||||
);
|
||||
}) => {
|
||||
const refFile = useRef(null);
|
||||
const refFolder = useRef(null);
|
||||
const refZip = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
const handleCancel = () => {
|
||||
console.log("cancel");
|
||||
};
|
||||
[refFile, refFolder, refZip].map((ref) =>
|
||||
ref.current?.addEventListener("cancel", handleCancel),
|
||||
);
|
||||
return () => {
|
||||
[refFile, refFolder, refZip].map((ref) =>
|
||||
ref.current?.removeEventListener("cancel", handleCancel),
|
||||
);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<input ref={refFile} {...getFileSelectorInputProps()} />
|
||||
<input ref={refFolder} {...getFolderSelectorInputProps()} />
|
||||
<input ref={refZip} {...getZipFileSelectorInputProps()} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const desktopFilesAndZipItems = async (electron: Electron, files: File[]) => {
|
||||
const fileAndPaths: FileAndPath[] = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user