fix: guard stopManualPhoto() call — mode switching threw ReferenceError

setAddAssetMode() called stopManualPhoto() which was removed during
the canvas→file-input refactor. Every mode switch failed silently.
This commit is contained in:
2026-05-21 21:42:01 -04:00
parent 78dbdfd5c5
commit 5822dfc1ab
2 changed files with 118 additions and 2 deletions
+2 -2
View File
@@ -809,7 +809,7 @@
═══════════════════════════════════════════════════════════════════════ -->
<div id="tabAddAsset" class="tab-panel active">
<!-- Hidden photo picker input -->
<input type="file" id="photoPicker" accept="image/*" capture="environment" style="display:none;" onchange="handlePickedPhoto(event)">
<input type="file" id="photoPicker" accept="image/*" style="display:none;">
<!-- Mode Toggles -->
<div class="mode-toggles">
<button class="mode-toggle active" data-mode="barcode" onclick="setAddAssetMode('barcode')">📷 Barcode</button>
@@ -1693,7 +1693,7 @@
// Stop any running scanners
stopScanning();
stopOcrCamera();
stopManualPhoto();
if (typeof stopManualPhoto === 'function') stopManualPhoto();
if (mode === 'barcode') {
startScanning();