Don't upload file if "Use URL" is selected
## Issue When pressing "Done", it will call the upload function, which usually results in a "please select a file" error, or the file being uploaded if a file was selected prior to switching to "Use Url".
This commit is contained in:
parent
02accb5c79
commit
0f5948d871
1 changed files with 5 additions and 1 deletions
|
@ -141,7 +141,11 @@ function SelectAsset(props: Props) {
|
|||
type="submit"
|
||||
label={useUrl ? __('Done') : __('Upload')}
|
||||
disabled={!useUrl && (uploadStatus === STATUS.UPLOADING || !pathSelected || !fileSelected)}
|
||||
onClick={() => doUploadAsset()}
|
||||
onClick={() => {
|
||||
if (!useUrl) {
|
||||
doUploadAsset();
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<FormField
|
||||
|
|
Loading…
Reference in a new issue