From c7e4832441d0c0a91794bafe3f7fdda7506e798f Mon Sep 17 00:00:00 2001 From: AyrisAI Date: Thu, 20 Aug 2026 23:58:21 +0300 Subject: [PATCH] fix(mobile): do not mutate SVG attributes, only replace qr-placeholder group --- apps/mobile/src/app/menu/qr.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/mobile/src/app/menu/qr.tsx b/apps/mobile/src/app/menu/qr.tsx index 6728f81..e52bf33 100644 --- a/apps/mobile/src/app/menu/qr.tsx +++ b/apps/mobile/src/app/menu/qr.tsx @@ -45,22 +45,19 @@ export default function QrScreen() { const currentSvgRaw = MOBILE_SVG_TEMPLATES[selectedKey] || MOBILE_SVG_TEMPLATES["qr-4"] || Object.values(MOBILE_SVG_TEMPLATES)[0] || ""; // Inject the live QR code image directly into the SVG's #qr-placeholder group + // SVG içeriğine başka hiçbir şey dokunulmaz, sadece #qr-placeholder replace edilir function buildSvgWithQr(svgRaw: string, pngBase64: string): string { const qrImgTag = ` `; - // Replace the entire qr-placeholder group - const replaced = svgRaw.replace( + return svgRaw.replace( //, qrImgTag ); - // Also ensure the SVG scales properly by setting width/height to 100% - return replaced - .replace(/width="400"/, 'width="100%"') - .replace(/height="650"/, 'height="100%"'); } + useEffect(() => { (async () => { const activeRest = await getActiveRestaurant();