Skip to content

Commit

Permalink
Fix is wechat function (#133)
Browse files Browse the repository at this point in the history
Co-authored-by: AceDataCloud <office@acedata.cloud>
  • Loading branch information
Germey and AceDataCloud authored Aug 30, 2024
1 parent 64d3f8f commit d5b58bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix is wechat browser",
"packageName": "@acedatacloud/nexior",
"email": "office@acedata.cloud",
"dependentChangeType": "patch"
}
3 changes: 2 additions & 1 deletion src/utils/is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export const isJSONString = (str: string): boolean => {
* Check if the string is wechat browser
*/
export const isWechatBrowser = (): boolean => {
return /micromessenger/i.test(navigator.userAgent);
const ua = navigator.userAgent.toLowerCase();
return ua.includes('micromessenger');
};

/**
Expand Down

0 comments on commit d5b58bb

Please sign in to comment.