remove use of deprecated DomException code property

This commit is contained in:
David Lechner
2022-10-14 16:21:18 -05:00
committed by David Lechner
parent eb26bfcf1b
commit db43cb3e99
3 changed files with 9 additions and 30 deletions
+2 -8
View File
@@ -638,10 +638,7 @@ function* handleFlashUsbDfu(action: ReturnType<typeof firmwareFlashUsbDfu>): Gen
],
})
.catch((err) => {
if (
err instanceof DOMException &&
err.code === DOMException.NOT_FOUND_ERR
) {
if (err instanceof DOMException && err.name === 'NotFoundError') {
// user clicked cancel button
return undefined;
}
@@ -685,10 +682,7 @@ function* handleFlashUsbDfu(action: ReturnType<typeof firmwareFlashUsbDfu>): Gen
defer.push(() =>
dfu.close().catch((err) => {
if (
err instanceof DOMException &&
err.code === DOMException.NETWORK_ERR
) {
if (err instanceof DOMException && err.name === 'NetworkError') {
// device was disconnected
return;
}