Skip to content

Commit

Permalink
fix: cancelling empty prompt (#7010)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbekas authored Dec 19, 2023
1 parent 0c278b0 commit 2ec8406
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/decap-cms-widget-file/src/withFileControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ export default function withFileControl({ forImage } = {}) {

const url = window.prompt(this.props.t(`editor.editorWidgets.${subject}.promptUrl`));

return this.props.onChange(url);
if (url) {
return this.props.onChange(url);
}
};

handleRemove = e => {
Expand Down

0 comments on commit 2ec8406

Please sign in to comment.