From 2de4cbc00fd934171bd22c73eae6ae5cdf3177ce Mon Sep 17 00:00:00 2001 From: duffyduck Date: Sun, 10 May 2026 18:42:53 +0200 Subject: [PATCH] fix(app): SVG-Anhaenge mit SvgUri rendern statt Image Co-Authored-By: Claude Opus 4.7 (1M context) --- android/src/screens/ChatScreen.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/android/src/screens/ChatScreen.tsx b/android/src/screens/ChatScreen.tsx index 7c2dc27..e8b4ade 100644 --- a/android/src/screens/ChatScreen.tsx +++ b/android/src/screens/ChatScreen.tsx @@ -24,6 +24,7 @@ import { } from 'react-native'; import AsyncStorage from '@react-native-async-storage/async-storage'; import RNFS from 'react-native-fs'; +import { SvgUri } from 'react-native-svg'; import rvs, { RVSMessage, ConnectionState } from '../services/rvs'; import audioService from '../services/audio'; import wakeWordService from '../services/wakeword'; @@ -113,7 +114,9 @@ const ChatImage: React.FC<{ onError: () => void; }> = ({ uri, onPress, onError }) => { const [aspectRatio, setAspectRatio] = useState(4 / 3); + const isSvg = /\.svg(?:\?|$)/i.test(uri); useEffect(() => { + if (isSvg) return; // SvgUri hat kein getSize let cancelled = false; Image.getSize(uri, (w, h) => { if (!cancelled && w > 0 && h > 0) { @@ -124,7 +127,16 @@ const ChatImage: React.FC<{ } }, () => {}); return () => { cancelled = true; }; - }, [uri]); + }, [uri, isSvg]); + if (isSvg) { + return ( + + + + + + ); + } return (