mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-02 16:38:14 +00:00
Merge pull request #263 from storytold/olivicmic-fy-lipsync-revamp
onSubmit typing on useFile changed to use async functions
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user