Skip to content

Commit e659347

Browse files
committed
Adapt to WeChat Trial Mode.
1 parent 406dbd0 commit e659347

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

pal/minigame/wechat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Object.defineProperty(minigame, 'isLandscape', {
150150
});
151151
// init landscapeOrientation as LANDSCAPE_RIGHT
152152
let landscapeOrientation = Orientation.LANDSCAPE_RIGHT;
153-
if (devideInfo.platform.toLocaleLowerCase() !== 'android') {
153+
if (devideInfo.platform.toLocaleLowerCase() !== 'android' && !globalThis.runOnPlayableMode) {
154154
// onDeviceOrientationChange doesn't work well on Android.
155155
// see this issue: https://developers.weixin.qq.com/community/minigame/doc/000482138dc460e56cfaa5cb15bc00
156156
wx.onDeviceOrientationChange((res) => {

pal/system-info/minigame/system-info.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ class SystemInfo extends EventTarget {
263263

264264
this._initPromise.push(this._supportsWebpPromise());
265265

266-
this._registerEvent();
266+
if (!globalThis.runOnPlayableMode) {
267+
this._registerEvent();
268+
}
267269
}
268270

269271
private _supportsWebpPromise (): Promise<void> {

0 commit comments

Comments
 (0)