diff --git a/packages/frontend/src/components/MkImgWithBlurhash.vue b/packages/frontend/src/components/MkImgWithBlurhash.vue
index ebca855ed0..22619ba2fd 100644
--- a/packages/frontend/src/components/MkImgWithBlurhash.vue
+++ b/packages/frontend/src/components/MkImgWithBlurhash.vue
@@ -1,5 +1,6 @@
@@ -61,9 +62,13 @@ const offscreen = computed(() => {
}, [_offscreen]);
return _offscreen;
});
+let loaded = $ref(false);
let canvasWidth = $ref(props.width);
let canvasHeight = $ref(props.height);
-let url = $ref();
+
+function onLoad() {
+ loaded = true;
+}
watch([() => props.width, () => props.height], () => {
const ratio = props.width / props.height;
@@ -78,20 +83,6 @@ watch([() => props.width, () => props.height], () => {
immediate: true,
});
-watch([() => props.src], () => {
- if (url) {
- URL.revokeObjectURL(url);
- url = undefined;
- }
- if (props.src) {
- fetch(props.src, { mode: 'no-cors' })
- .then((res) => res.blob())
- .then((blob) => {
- url = URL.createObjectURL(blob);
- });
- }
-}, { immediate: true });
-
function draw() {
if (props.hash == null || !offscreen.value) return;
worker.postMessage({
@@ -112,7 +103,7 @@ onMounted(() => {
} else {
// 100ms後に画像の読み込みが完了していなければblurhashを描画する
setTimeout(() => {
- if (!url) {
+ if (!loaded) {
draw();
}
}, 100);