From 1f188a65cd595b391aff9bd08876aa9093c6a28d Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Mon, 29 Jul 2024 22:28:55 +0800 Subject: [PATCH] feat: Close camera after recognizing QR code After recognizing a QR code, the camera is now closed to improve the user experience. If the QR code is a test code for Pushy, the camera is closed and no further scanning is performed. For other business logic, the scanning process continues. Co-authored-by: dependabot[bot] --- site/pages/docs/api.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/site/pages/docs/api.mdx b/site/pages/docs/api.mdx index 27311df..8541edc 100644 --- a/site/pages/docs/api.mdx +++ b/site/pages/docs/api.mdx @@ -323,10 +323,11 @@ interface PushyContext { ```js { + // 识别到二维码后先关闭相机 + setShowCamera(false); // 先解析是否是pushy的测试二维码 if (parseTestQrCode(codeStringValue)) { - // 如果是pushy的测试二维码,则不再继续扫描 - setShowCamera(false); + // 如果是pushy的测试二维码,则不再做其他业务扫码逻辑 return; } // 如果不是,继续处理其他业务扫码逻辑