From 81e9ed01298af6268b68953f6a98136928c41f10 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Tue, 18 Nov 2025 21:18:40 +0100 Subject: [PATCH] feat(assets): clean up imgs --- app/composables/useImages.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/composables/useImages.ts b/app/composables/useImages.ts index fd2b81e..f69c4bf 100644 --- a/app/composables/useImages.ts +++ b/app/composables/useImages.ts @@ -1,6 +1,16 @@ -export const useImages = (...paths: string[]) => - paths.map((path) => { +export const useImages = (...paths: string[]) => { + const images = paths.map((path) => { const img = document.createElement("img"); img.src = path; return img; }); + + onBeforeUnmount(() => { + images.forEach((img) => { + img.src = ""; + img.remove(); + }); + }); + + return images; +};