Skip to content

Commit

Permalink
chore: test react-device-detect package
Browse files Browse the repository at this point in the history
  • Loading branch information
hasan-deriv committed Apr 15, 2024
1 parent 397a006 commit a71712a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/shared/src/utils/os/os_detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ export const OSDetect = () => {
};

export const mobileOSDetect = () => {
// eslint-disable-next-line no-console
console.log('==>', mobileVendor);
const userAgent = navigator.userAgent || navigator.vendor || window.opera || '';
// huawei devices regex from: https://gist.github.com/megaacheyounes/e1c7eec5c790e577db602381b8c50bfa
const huaweiDevicesRegex =
Expand Down Expand Up @@ -111,6 +109,8 @@ export const mobileOSDetect = () => {
};

export const mobileOSDetectAsync = async () => {
// eslint-disable-next-line no-console
console.log('==>', { mobileVendor });
const userAgent = navigator.userAgent || navigator.vendor || window.opera || '';
const huaweiDevicesRegex =
/\b(ALP-|AMN-|ANA-|ANE-|ANG-|AQM-|ARS-|ART-|ATU-|BAC-|BLA-|BRQ-|CAG-|CAM-|CAN-|CAZ-|CDL-|CDY-|CLT-|CRO-|CUN-|DIG-|DRA-|DUA-|DUB-|DVC-|ELE-|ELS-|EML-|EVA-|EVR-|FIG-|FLA-|FRL-|GLK-|HMA-|HW-|HWI-|INE-|JAT-|JEF-|JER-|JKM-|JNY-|JSC-|LDN-|LIO-|LON-|LUA-|LYA-|LYO-|MAR-|MED-|MHA-|MLA-|MRD-|MYA-|NCE-|NEO-|NOH-|NOP-|OCE-|PAR-|PIC-|POT-|PPA-|PRA-|RNE-|SEA-|SLA-|SNE-|SPN-|STK-|TAH-|TAS-|TET-|TRT-|VCE-|VIE-|VKY-|VNS-|VOG-|VTR-|WAS-|WKG-|WLZ-|JAD-|MLD-|RTE-|NAM-|NEN-|BAL-|JLN-|YAL|MGA-|FGD-|XYAO-|BON-|ALN-|ALT-|BRA-|DBY2-|STG-|MAO-|LEM-|GOA-|FOA-|MNA-|LNA-)\b/i;
Expand Down

0 comments on commit a71712a

Please sign in to comment.