Merge pull request #263 from storytold/olivicmic-fy-lipsync-revamp

onSubmit typing on useFile changed to use async functions
This commit is contained in:
Brandon Thomas authored and GitHub committed 2023-08-14 17:55:11 -04:00
commit f702bb4f07
1 file changed
+2 -2
@@ -6,7 +6,7 @@ interface Props {
debug?: any;
onChange?: (file: any) => void;
onClear?: (x?: any) => void;
onSubmit?: (file: any) => boolean;
onSubmit?: (file: any) => Promise<boolean>;
}
export default function useFile({ debug, onChange = n, onClear = n, onSubmit = n }: Props) {
@@ -21,7 +21,7 @@ export default function useFile({ debug, onChange = n, onClear = n, onSubmit = n
const onUploadResult = await onSubmit(file);
workingSet(true);
if (onUploadResult) { successSet(true); }
successSet(false);
else successSet(false);
};
const fileChange = (inputFile?: any) => {
onChange(file);