Skip to content

Commit

Permalink
fix(scanner): removed return from useEffect inside ScannerInit
Browse files Browse the repository at this point in the history
  • Loading branch information
opensrc0 committed Mar 24, 2024
1 parent 7f9f9cc commit b9a68a2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions __app/component/Scanner/ScannerInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,21 @@ function ScannerInit({
startVideo();
};

useEffect(() => {
setIsBrowser(true);

const handleBrowserSupport = () => {
if (ScannerInit.isBrowserSupport()) {
facingMode = cameraType === 'back' ? 'environment' : 'user';
startVideo();
} else {
return handleError({ disbaleToast, msgType: 'UN_SUPPORTED_FEATURE', msg: failureMsg.unSupported, failureCb });
}

return true;
};

useEffect(() => {
setIsBrowser(true);
handleBrowserSupport();

return () => {
allClear();
};
Expand Down

0 comments on commit b9a68a2

Please sign in to comment.