Skip to content

Commit

Permalink
Do not show image preview if not an image
Browse files Browse the repository at this point in the history
  • Loading branch information
zackify committed Aug 3, 2018
1 parent f5b4873 commit 7a31b03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controls/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gutenblock-controls",
"version": "1.0.1",
"version": "1.0.2",
"description": "Useful inspector controls for gutenberg",
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion controls/src/form/media-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { MediaUpload } = wp.editor;

export default ({ name, attributes, onChange, beforeChange, label, ...props }) => (
<div style={{ display: 'flex' }}>
{attributes[name] ? (
{attributes[name] && !beforeChange ? (
<img src={attributes[name]} style={{ height: 10, marginRight: 5, alignSelf: 'center' }} />
) : null}
<MediaUpload
Expand Down

0 comments on commit 7a31b03

Please sign in to comment.