Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const isWebUsbSupported = async () => {
const isSupported = await webUsbTransport.isSupported();
return (
isSupported && platform.os.family !== 'Windows' && platform.name !== 'Opera' // take it out later once the windows issue is fixed
);
};
useEffect(() => {
// TODO: Temporary workaround for Ledger USB issues on Windows
if (!navigator.platform.includes('Win')) {
TransportWebUSB.isSupported()
.then(setWebUSBSupported)
.catch(() => setWebUSBSupported(false));
}
}, []);