Pause the camera and scanner, when navigating away from the scanner page, so that the camera feed is closed

This commit is contained in:
Jan Böhmer 2025-01-04 18:10:26 +01:00
parent 0c627a5636
commit 22fba37d28

View file

@ -61,6 +61,11 @@ export default class extends Controller {
this._scanner.render(this.onScanSuccess.bind(this));
}
disconnect() {
this._scanner.pause();
this._scanner.clear();
}
onScanSuccess(decodedText, decodedResult) {
//Put our decoded Text into the input box
document.getElementById('scan_dialog_input').value = decodedText;