launchpad-ledger: Rename isChrome -> isChromeOrBrave

This commit is contained in:
willclarktech 2020-09-10 11:46:54 +02:00
parent 5a970ab6ca
commit 78fb56856c
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7

View File

@ -23,9 +23,8 @@ function verifyBrowserIsSupported(platform: string, userAgent: string): void {
throw new Error("Windows is not currently supported.");
}
const ua = userAgent.toLowerCase();
const isChrome = /chrome|crios/.test(ua) && !/edge|opr\//.test(ua);
if (!isChrome) {
const isChromeOrBrave = /chrome|crios/i.test(userAgent) && !/edge|opr\//i.test(userAgent);
if (!isChromeOrBrave) {
throw new Error("Your browser does not support Ledger devices.");
}
}