Show preview if URL is already set

This commit is contained in:
Justin Foell
2020-03-27 13:58:04 -05:00
parent bb7aad9063
commit 3e922a55ba
+2 -1
View File
@@ -1,6 +1,7 @@
/* global wp, wpStrava */
import EmbedPlaceholder from './embed-placeholder';
import EmbedControls from './embed-controls';
const { isEmpty } = lodash;
const { Component } = wp.element;
@@ -19,8 +20,8 @@ class Edit extends Component {
this.switchBackToURLInput = this.switchBackToURLInput.bind( this );
this.state = {
editingURL: true,
url: this.props.attributes.url,
editingURL: isEmpty( this.props.attributes.url ) ? true : false,
};
}