From 4717375044958a0f7275af85faac8b4ac7b2c08b Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Fri, 21 Mar 2025 17:12:10 +0100 Subject: [PATCH] Applied code formatting rules --- public/viewjs/components/camerabarcodescanner.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public/viewjs/components/camerabarcodescanner.js b/public/viewjs/components/camerabarcodescanner.js index eb6afe9f..56c21d14 100644 --- a/public/viewjs/components/camerabarcodescanner.js +++ b/public/viewjs/components/camerabarcodescanner.js @@ -78,8 +78,10 @@ Grocy.Components.CameraBarcodeScanner.StartScanning = function() Grocy.Components.CameraBarcodeScanner.Scanner.decodeFromVideoDevice( window.localStorage.getItem('cameraId'), document.querySelector("#camerabarcodescanner-livestream"), - (result, error) => { - if (error) { + (result, error) => + { + if (error) + { return; } @@ -90,7 +92,8 @@ Grocy.Components.CameraBarcodeScanner.StartScanning = function() $(".modal").last().modal("hide"); } ) - .then(() => { + .then(() => + { Grocy.Components.CameraBarcodeScanner.CheckCapabilities(); if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA) @@ -101,7 +104,8 @@ Grocy.Components.CameraBarcodeScanner.StartScanning = function() }, 250); } }) - .catch((error) => { + .catch((error) => + { Grocy.FrontendHelpers.ShowGenericError("Error while initializing the barcode scanning library", error.message); toastr.info(__t("Camera access is only possible when supported and allowed by your browser and when Grocy is served via a secure (https://) connection")); window.localStorage.removeItem("cameraId"); @@ -165,7 +169,8 @@ $(document).on("click", "#camerabarcodescanner-start-button", async function(e) className: 'btn-warning responsive-button torch', callback: function() { - if (Grocy.Components.CameraBarcodeScanner.Scanner.stream) { + if (Grocy.Components.CameraBarcodeScanner.Scanner.stream) + { Grocy.Components.CameraBarcodeScanner.TorchToggle(Grocy.Components.CameraBarcodeScanner.Scanner.stream.getVideoTracks()[0]); } return false;