From b44b6bafd8ebbbae34035c31fe5e453ed54cd8b2 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Mon, 13 Nov 2023 16:58:38 -0500 Subject: [PATCH] Fix custom icon handling when configuring custom directory AND sub-folder. --- resources/js/components/SvgIcon.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/js/components/SvgIcon.vue b/resources/js/components/SvgIcon.vue index 502723c3d3..a84addd2e2 100644 --- a/resources/js/components/SvgIcon.vue +++ b/resources/js/components/SvgIcon.vue @@ -34,7 +34,16 @@ export default { customIcon() { if (! this.directory) return; - return data_get(this.$config.get('customSvgIcons') || {}, `${this.directory}.${this.name}`); + let directory = this.directory; + let folder = null; + let file = this.name; + + if (this.name.includes('/')) { + [folder, file] = this.name.split('/'); + directory = directory+'/'+folder; + } + + return data_get(this.$config.get('customSvgIcons') || {}, `${directory}.${file}`); }, },