settings: remove unsupported screen orientation lock on iPad, closes #1520 (#1522)

This commit is contained in:
Huang Xin
2025-07-03 19:41:42 +08:00
committed by GitHub
parent c6a638dbfd
commit 59013be586
4 changed files with 7 additions and 2 deletions
@@ -676,7 +676,7 @@ const LayoutPanel: React.FC<SettingsPanelPanelProp> = ({ bookKey, onRegisterRese
</div>
</div>
{appService?.isMobileApp && (
{appService?.hasOrientationLock && (
<div className='w-full'>
<h2 className='mb-2 font-medium'>{_('Screen')}</h2>
<div className='card border-base-200 bg-base-100 border shadow'>
@@ -63,6 +63,7 @@ export abstract class BaseAppService implements AppService {
hasSafeAreaInset = false;
hasHaptics = false;
hasUpdater = false;
hasOrientationLock = false;
distChannel = 'readest';
abstract fs: FileSystem;
@@ -19,7 +19,7 @@ import { type as osType } from '@tauri-apps/plugin-os';
import { Book } from '@/types/book';
import { FileSystem, BaseDir, AppPlatform } from '@/types/system';
import { isContentURI, isValidURL } from '@/utils/misc';
import { getOSPlatform, isContentURI, isValidURL } from '@/utils/misc';
import { getCoverFilename, getFilename } from '@/utils/book';
import { copyURIToPath } from '@/utils/bridge';
import { NativeFile, RemoteFile } from '@/utils/file';
@@ -227,6 +227,9 @@ export class NativeAppService extends BaseAppService {
OS_TYPE !== 'ios' &&
!process.env['NEXT_PUBLIC_DISABLE_UPDATER'] &&
!window.__READEST_UPDATER_DISABLED;
// orientation lock is not supported on iPad
override hasOrientationLock =
(OS_TYPE === 'ios' && getOSPlatform() === 'ios') || OS_TYPE === 'android';
override distChannel = process.env['NEXT_PUBLIC_DIST_CHANNEL'] || 'readest';
override resolvePath(fp: string, base: BaseDir): { baseDir: number; base: BaseDir; fp: string } {
+1
View File
@@ -34,6 +34,7 @@ export interface AppService {
hasSafeAreaInset: boolean;
hasHaptics: boolean;
hasUpdater: boolean;
hasOrientationLock: boolean;
isMobile: boolean;
isAppDataSandbox: boolean;
isMobileApp: boolean;