diff --git a/src/pages/Connection.tsx b/src/pages/Connection.tsx index 4abd76e..e7554da 100644 --- a/src/pages/Connection.tsx +++ b/src/pages/Connection.tsx @@ -364,31 +364,15 @@ export default function Connection() { // Get sanitized SVG HTML const getSvgHtml = (svgKey: string | undefined): string => { - if (!svgKey || !appConfig?.svgLibrary?.[svgKey]?.svgString) return ''; - return DOMPurify.sanitize(appConfig.svgLibrary[svgKey].svgString, { + if (!svgKey || !appConfig?.svgLibrary?.[svgKey]) return ''; + const entry = appConfig.svgLibrary[svgKey]; + const raw = typeof entry === 'string' ? entry : entry.svgString; + if (!raw) return ''; + return DOMPurify.sanitize(raw, { USE_PROFILES: { svg: true, svgFilters: true }, }); }; - // DEBUG: log app data to check svgIconKey presence - if (isRemnawave && appConfig?.platforms) { - const firstPlatformKey = Object.keys(appConfig.platforms)[0]; - if (firstPlatformKey) { - const pd = appConfig.platforms[firstPlatformKey]; - if (pd && !Array.isArray(pd) && 'apps' in pd) { - console.log( - '[DEBUG] RemnaWave apps:', - pd.apps.map((a: RemnawaveAppClient) => ({ - name: a.name, - svgIconKey: a.svgIconKey, - keys: Object.keys(a), - })), - ); - console.log('[DEBUG] svgLibrary keys:', Object.keys(appConfig.svgLibrary || {})); - } - } - } - // Loading if (isLoading) { return ( @@ -556,7 +540,21 @@ export default function Connection() {