Skip to content

Commit 5fdd83e

Browse files
authored
fix: Determine the higher version of WeChat browser for Windows (ianstormtaylor#5913)
* fix: Determine the higher version of WeChat browser for Windows * fix: judgment logic optimization
1 parent f2ea1e1 commit 5fdd83e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/slate-dom/src/utils/environment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export const IS_UC_MOBILE =
5252
export const IS_WECHATBROWSER =
5353
typeof navigator !== 'undefined' &&
5454
/.*Wechat/.test(navigator.userAgent) &&
55-
!/.*MacWechat/.test(navigator.userAgent) // avoid lookbehind (buggy in safari < 16.4)
56-
55+
!/.*MacWechat/.test(navigator.userAgent) && // avoid lookbehind (buggy in safari < 16.4)
56+
(!IS_CHROME || IS_CHROME_LEGACY) // wechat and low chrome is real wechat
5757
// Check if DOM is available as React does internally.
5858
// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js
5959
export const CAN_USE_DOM = !!(

0 commit comments

Comments
 (0)