Skip to content

Commit

Permalink
fix: issue with images not showing up in image selector after upload
Browse files Browse the repository at this point in the history
  • Loading branch information
akinsey committed Nov 18, 2021
1 parent 45f4169 commit 715a261
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/images/ImageUploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
<!-- image picker header -->
<div class="header" :class="{ 'added': image.added }" >
(<span v-html="image.progress"></span>%):
<a :href="image.url" target="_blank" v-if="image.url">
<a :href="imageUrl(image)" target="_blank" v-if="image.url">
<span v-html="image.name"></span>
</a>
<span v-html="image.status" v-if="!image.url"></span>
</div>
<!-- image picker body -->
<div class="picker-body">
<img :src="image.url" @click="fireDone(image)"/>
<img :src="imageUrl(image)" @click="fireDone(image)"/>
<a class="after" v-if="image.url" @click="fireDone(image)">
<div>
<span class="stroke" v-if="!image.added">Add to Editor</span>
Expand Down Expand Up @@ -75,6 +75,8 @@ export default {
components: { Modal },
setup(props, { emit }) { //, { emit }) {
/* View Methods */
const imageUrl = image => 'http://localhost:8080' + image.url
const uploadFile = (e) => {
v.hover = false
emit('upload-error', null) // clear previous errors
Expand Down Expand Up @@ -243,7 +245,7 @@ export default {
watch(() => v.hover, a => a ? null : emit('hover-stop'))
return { ...toRefs(v), uploadFile, fireDone }
return { ...toRefs(v), imageUrl, uploadFile, fireDone }
}
}
</script>
Expand Down

0 comments on commit 715a261

Please sign in to comment.