🐛 Re: #199 - Fixes loading of local SVG icons

This commit is contained in:
Alicia Sykes 2021-09-04 20:50:36 +01:00
parent b756e65d2e
commit 412c179d5a
1 changed files with 1 additions and 2 deletions

View File

@ -62,7 +62,7 @@ export default {
/* Returns true if the input is a path to an image file */ /* Returns true if the input is a path to an image file */
isImage(img) { isImage(img) {
const fileExtRegex = /(?:\.([^.]+))?$/; const fileExtRegex = /(?:\.([^.]+))?$/;
const validImgExtensions = ['png', 'jpg']; const validImgExtensions = ['svg', 'png', 'jpg'];
const splitPath = fileExtRegex.exec(img); const splitPath = fileExtRegex.exec(img);
if (splitPath.length >= 1) return validImgExtensions.includes(splitPath[1]); if (splitPath.length >= 1) return validImgExtensions.includes(splitPath[1]);
return false; return false;
@ -154,7 +154,6 @@ export default {
determineImageType(img) { determineImageType(img) {
let imgType = ''; let imgType = '';
if (!img) imgType = 'none'; if (!img) imgType = 'none';
else if (img.endsWith('.svg')) imgType = 'svg';
else if (this.isUrl(img)) imgType = 'url'; else if (this.isUrl(img)) imgType = 'url';
else if (this.isImage(img)) imgType = 'img'; else if (this.isImage(img)) imgType = 'img';
else if (img.includes('fa-')) imgType = 'font-awesome'; else if (img.includes('fa-')) imgType = 'font-awesome';