Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion force-app/main/default/lwc/barcodeScanner/barcodeScanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ export default class BarcodeScanner extends NavigationMixin(LightningElement) {
myScanner;
scanButtonEnabled = false;
scannedQrCode = '';

// When the component is initialized, determine whether to enable the Scan button
connectedCallback() {
this.myScanner = getBarcodeScanner();
if (this.myScanner?.isAvailable()) {
this.scanButtonEnabled = true;
} else {
this.dishpatchevent(
new showToast({
tittle: 'hey your barcodde is not avaible ',
message: 'the barcode scanner is avaible ',
variant: 'error'
})
);
}
}

Expand Down