From 3e922a55ba0b351d4200165c6e829c9027dab055 Mon Sep 17 00:00:00 2001 From: Justin Foell <630830+jrfoell@users.noreply.github.com> Date: Fri, 27 Mar 2020 13:58:04 -0500 Subject: [PATCH] Show preview if URL is already set --- src/blocks/activity/edit.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blocks/activity/edit.js b/src/blocks/activity/edit.js index 74d9a9c..3499fc1 100644 --- a/src/blocks/activity/edit.js +++ b/src/blocks/activity/edit.js @@ -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, }; }