Skip to content

Commit

Permalink
fix(scanner flash): close flash if scanner is unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
opensrc0 committed May 22, 2024
1 parent e7160b9 commit edab101
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion __app/component/Scanner/Scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,13 @@ function Scanner({
handleBrowserSupport();

return () => {
if (flash) toggleFlash();
allClear();
};
}, []);

return isBrowserSupport() && (
<div id="scanner">
<div id="scanner" style={{ background: '#000000b3' }}>
<div id="camera" />
{
React.Children.map(children, (child) => React.cloneElement(child, {
Expand Down

0 comments on commit edab101

Please sign in to comment.