Skip to content

Update barcodeScanner.js#687

Open
Mayank-sudo wants to merge 1 commit intotrailheadapps:mainfrom
Mayank-sudo:patch-2
Open

Update barcodeScanner.js#687
Mayank-sudo wants to merge 1 commit intotrailheadapps:mainfrom
Mayank-sudo:patch-2

Conversation

@Mayank-sudo
Copy link

What does this PR do?
This PR adds the disconnectedCallback lifecycle hook to the BarcodeScanner component to ensure the barcode scanner is properly cleaned up when the component is removed from the DOM. It also includes a toast message to inform users when the barcode scanner is unavailable.

What issues does this PR fix or reference?
Fixes #1234

The PR fulfills these requirements:
[ ] Tests for the proposed changes have been added/updated.

[ ] Code linting and formatting was performed.

Functionality Before
Before this PR, the BarcodeScanner component did not disable the scan button when the barcode scanner was unavailable and lacked proper cleanup mechanisms.

I have added else condition here what it does give error when barcode scanner is noit avaiable
@Mayank-sudo Mayank-sudo requested a review from a team as a code owner January 28, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant