Skip to content

Commit

Permalink
fix(imageview): Don't try to load unresolved images
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Apr 11, 2024
1 parent 4fe2fad commit 99e7a7a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/nodes/ImageView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ export default {
methods: {
async loadPreview() {
this.attachment = await this.$attachmentResolver.resolve(this.src)
if (!this.attachment.previewUrl) {
this.loaded = true
this.failed = true
return
}
return new Promise((resolve, reject) => {
const img = new Image()
img.onload = async () => {
Expand Down

0 comments on commit 99e7a7a

Please sign in to comment.