catch dom exception on unmount in qr scanner

This commit is contained in:
keyan 2023-11-08 20:44:00 -06:00
parent 8566644ea1
commit 5b14606b39
1 changed files with 5 additions and 1 deletions

View File

@ -274,7 +274,11 @@ function InvoiceScanner ({ fieldName }) {
onClose() onClose()
}} }}
onError={(error) => { onError={(error) => {
if (error instanceof DOMException) {
console.log(error)
} else {
toaster.danger(error?.message || error?.toString?.()) toaster.danger(error?.message || error?.toString?.())
}
}} }}
/> />
) )