Files
discord-decomp/modules/activities/native/applyActivityOrientationLock.tsx
T
2026-11-01 12:12:55 +02:00

18 lines
693 B
TypeScript

// Metro module 15835 (f15836).
import { OrientationLockState } from "../Constants";
import { getIsTabletActivitySurface } from "./getDefaultOrientationLockState";
import { unlockOrientation, lockOrientation } from "../../device/native/DeviceOrientation";
export default function applyActivityOrientationLock(a0) {
if (!getIsTabletActivitySurface()) {
if (OrientationLockState.UNLOCKED === a0) {
unlockOrientation({
unlockAfterRotatingToPreviousLock: true
});
} else if (OrientationLockState.PORTRAIT === a0) {
lockOrientation("PORTRAIT", true);
} else if (OrientationLockState.LANDSCAPE === a0) {
lockOrientation("LANDSCAPE", true);
}
}
};