Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bytedance high performance mode check in sys.ts #16769

Merged
merged 1 commit into from Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions cocos/core/platform/sys.ts
Expand Up @@ -25,7 +25,7 @@

import { systemInfo } from 'pal/system-info';
import { screenAdapter } from 'pal/screen-adapter';
import { WECHAT, WECHAT_MINI_PROGRAM } from 'internal:constants';
import { BYTEDANCE, WECHAT, WECHAT_MINI_PROGRAM } from 'internal:constants';
import { legacyCC } from '../global-exports';
import { Rect } from '../math/rect';
import { Vec2 } from '../math/vec2';
Expand Down Expand Up @@ -312,7 +312,7 @@
localStorage.removeItem('storage');
localStorage = null;
} catch (e) {
const warn = function (...args: any): any {

Check warning on line 315 in cocos/core/platform/sys.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
warnID(5200);
};
this.localStorage = {
Expand All @@ -325,7 +325,7 @@
};
}

if (WECHAT || WECHAT_MINI_PROGRAM) {
if (WECHAT || WECHAT_MINI_PROGRAM || BYTEDANCE) {
this.__isWebIOS14OrIPadOS14Env = (sys.os === OS.IOS || sys.os === OS.OSX) && GameGlobal?.isIOSHighPerformanceMode
&& /(OS 1((4\.[0-9])|(5\.[0-3])))|(Version\/1((4\.[0-9])|(5\.[0-3])))/.test(window.navigator.userAgent);
} else {
Expand Down