diff options
author | Blaster4385 <[email protected]> | 2022-08-26 09:10:00 +0530 |
---|---|---|
committer | Blaster4385 <[email protected]> | 2022-08-26 09:10:00 +0530 |
commit | 34fc89bef7126966047cd748f94cf24f7a2d0788 (patch) | |
tree | c9c805fedc62d105a4495e2d9e51f0bc2c922457 /client/src/pages/Update/DocumentScanner | |
parent | bdd4ad1b8b071fd04f1025076174757f0f355315 (diff) |
Fix stuff
Diffstat (limited to 'client/src/pages/Update/DocumentScanner')
-rw-r--r-- | client/src/pages/Update/DocumentScanner/DocumentScanner.jsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/client/src/pages/Update/DocumentScanner/DocumentScanner.jsx b/client/src/pages/Update/DocumentScanner/DocumentScanner.jsx index 86674af..4fa07fb 100644 --- a/client/src/pages/Update/DocumentScanner/DocumentScanner.jsx +++ b/client/src/pages/Update/DocumentScanner/DocumentScanner.jsx @@ -71,6 +71,18 @@ const DocumentScanner = () => { }) }) + const language = localStorage.getItem('i18nextLng') + + let audio +const playAudio = () => { + if (language === 'en') { + audio = new Audio(`${process.env.PUBLIC_URL}/assets/audios/scan-documents-english.mp3`) + } else if (language === 'hi') { + audio = new Audio(`${process.env.PUBLIC_URL}/assets/audios/scan-documents-hindi.mp3`) + } + audio.play() +} + const handleNext = () => { if ( activeStep === steps.length - 1 && @@ -81,18 +93,25 @@ const DocumentScanner = () => { setUserData({ ...userData, documents: documents }) } else if (documents.POI !== '' && documents.POA !== '') { toast.error(t('SCAN_YOUR_DOCUMENT')) + playAudio() } else if (documents.POI !== '' && documents.DOB !== '') { toast.error(t('SCAN_YOUR_DOCUMENT')) + playAudio() } else if (documents.POA !== '' && documents.DOB !== '') { toast.error(t('SCAN_YOUR_DOCUMENT')) + playAudio() } else if (documents.POI !== '') { toast.error(t('SCAN_YOUR_DOCUMENT')) + playAudio() } else if (documents.POA !== '') { toast.error(t('SCAN_YOUR_DOCUMENT')) + playAudio() } else if (documents.DOB !== '') { toast.error(t('SCAN_YOUR_DOCUMENT')) + playAudio() } else { toast.error(t('SCAN_YOUR_DOCUMENT')) + playAudio() } if ( |