From 7b420e780ea9ffb89f980ca1652aefa3cf0b861e Mon Sep 17 00:00:00 2001
From: Michal Junek <michal@junek.pw>
Date: Mon, 7 Feb 2022 14:43:50 +0100
Subject: [master] Prevents race condition when loading images

Signed-off-by: Michal Junek <michal@junek.pw>
---
 src/nodes/ImageView.vue | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/nodes/ImageView.vue')

diff --git a/src/nodes/ImageView.vue b/src/nodes/ImageView.vue
index f8bd2ad6c..1142178c2 100644
--- a/src/nodes/ImageView.vue
+++ b/src/nodes/ImageView.vue
@@ -275,7 +275,6 @@ export default {
 			return
 		}
 		const img = new Image()
-		img.src = this.imageUrl
 		img.onload = () => {
 			this.imageLoaded = true
 		}
@@ -284,6 +283,7 @@ export default {
 			this.imageLoaded = false
 			this.loaded = true
 		}
+		img.src = this.imageUrl
 	},
 	methods: {
 		updateAlt() {
-- 
cgit v1.2.3

