Skip to content

Commit

Permalink
fix: ondevicechange error
Browse files Browse the repository at this point in the history
  • Loading branch information
GuMengYu committed Nov 3, 2023
1 parent f7fba5a commit 896a8f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hooks/useMediaDevices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export default function useMediaDevices() {
}
}
return () => {
navigator.mediaDevices.ondevicechange = null
if (navigator.mediaDevices)
navigator.mediaDevices.ondevicechange = null

}
}, [])
return {
Expand Down

0 comments on commit 896a8f0

Please sign in to comment.