Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
fix: stop redirect to google play store for non-google huawei devices (
Browse files Browse the repository at this point in the history
  • Loading branch information
leesalminen authored Dec 27, 2021
1 parent 430b943 commit 8189266
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ export const getOS = () => {
return undefined
}

// Non-Google Huawei detection from: https://stackoverflow.com/questions/66048820
if (/HMSCore\//.test(userAgent) && !/GMS\//.test(userAgent)) {
return "huawei"
}

if (/android/i.test(userAgent)) {
return "android"
}
Expand Down

0 comments on commit 8189266

Please sign in to comment.