From 7c00a0b6a3c8dd383ce79ee1b96faff5d1b369a4 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Mon, 10 Jul 2023 10:16:38 +0800 Subject: [PATCH] fix voice input in safari (#537) --- web/app/components/base/voice-input/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/app/components/base/voice-input/index.tsx b/web/app/components/base/voice-input/index.tsx index 19d9c63ae1..f1b020c916 100644 --- a/web/app/components/base/voice-input/index.tsx +++ b/web/app/components/base/voice-input/index.tsx @@ -56,7 +56,10 @@ const VoiceInput = ({ const y = (v - 128) / 50 * canvas.height ctx.moveTo(x, 16) - ctx.roundRect(x, 16 - y, 2, y, [1, 1, 0, 0]) + if (ctx.roundRect) + ctx.roundRect(x, 16 - y, 2, y, [1, 1, 0, 0]) + else + ctx.rect(x, 16 - y, 2, y) ctx.fill() x += 3 }