camera-5.1: catch error in start_check_auto_torch

This commit is contained in:
Fam Zheng 2025-12-15 09:17:21 +00:00
parent 6174b2af43
commit 8aafe16bf6

View File

@ -192,6 +192,7 @@ function do_handle_frame() {
async function start_check_auto_torch(qrcode) async function start_check_auto_torch(qrcode)
{ {
should_check_auto_torch = false; should_check_auto_torch = false;
try {
var r = await fetch("https://themblem.com/api/v1/check-auto-torch/?qrcode=" + encodeURIComponent(qrcode), { var r = await fetch("https://themblem.com/api/v1/check-auto-torch/?qrcode=" + encodeURIComponent(qrcode), {
method: "GET", method: "GET",
}); });
@ -201,6 +202,9 @@ async function start_check_auto_torch(qrcode)
toggle_torch(); toggle_torch();
} }
camera_sensitivity = d.camera_sensitivity || 1.0; camera_sensitivity = d.camera_sensitivity || 1.0;
} catch (e) {
debug_log("start_check_auto_torch exception: " + e);
}
setTimeout(() => { setTimeout(() => {
done_checking_auto_torch = true; done_checking_auto_torch = true;
}, 200); }, 200);