From 412c179d5a87a86934a8f325fd81620b34e672d0 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 4 Sep 2021 20:50:36 +0100 Subject: [PATCH] :bug: Re: #199 - Fixes loading of local SVG icons --- src/components/LinkItems/ItemIcon.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/LinkItems/ItemIcon.vue b/src/components/LinkItems/ItemIcon.vue index 6f7c392b..b8c3f9c6 100644 --- a/src/components/LinkItems/ItemIcon.vue +++ b/src/components/LinkItems/ItemIcon.vue @@ -62,7 +62,7 @@ export default { /* Returns true if the input is a path to an image file */ isImage(img) { const fileExtRegex = /(?:\.([^.]+))?$/; - const validImgExtensions = ['png', 'jpg']; + const validImgExtensions = ['svg', 'png', 'jpg']; const splitPath = fileExtRegex.exec(img); if (splitPath.length >= 1) return validImgExtensions.includes(splitPath[1]); return false; @@ -154,7 +154,6 @@ export default { determineImageType(img) { let imgType = ''; if (!img) imgType = 'none'; - else if (img.endsWith('.svg')) imgType = 'svg'; else if (this.isUrl(img)) imgType = 'url'; else if (this.isImage(img)) imgType = 'img'; else if (img.includes('fa-')) imgType = 'font-awesome';