Ghost/ghost/admin/app/components/gh-image-uploader-with-preview.hbs
Kevin Ansfield 84d3643e9f 🐛 Fixed error when removing Facebook/Twitter social images on general settings screen
refs https://github.com/TryGhost/Team/issues/836
refs ceb16b5e9f

Problem:
- `<GhImageUploaderWithPreview>` was updated to swap deprecated `{{action}}` usage to `{{on "click"}}` but that came with a missed behaviour change because the click event will now be passed as the argument to `@remove`
- the `<GhImageUploaderWithPreview>` usage on the general settings screen for social images had a syntax error in it's usage of the `mut` helper that meant the supplied argument was being used as the value rather than a forced `""` value. Result was that we were replacing the image urls with a text representation of the click event when attempting to remove images, leaving a broken image in place and no way to upload a new image

Fix:
- fixed incorrect `mut` usage to correctly force `""` as the value when removing social icons
- updated `<GhImageUploaderWithPreview>` to force `""` as the argument passed to `@remove` to avoid any other issues due to the behaviour change
2021-06-29 17:54:09 +01:00

18 lines
557 B
Handlebars

{{#if @image}}
<div class="gh-image-uploader -with-image">
<div><img src={{@image}}></div>
<a class="image-delete" title="Delete" {{on "click" (fn @remove "")}}>
{{svg-jar "trash"}}
<span class="hidden">Delete</span>
</a>
</div>
{{else}}
<GhImageUploader
@text={{@text}}
@altText={{@altText}}
@allowUnsplash={{@allowUnsplash}}
@update={{@update}}
@uploadStarted={{optional @uploadStarted}}
@uploadFinished={{optional @uploadFinished}}
/>
{{/if}}