mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-01 10:56:42 +02:00
Don't render MKB settings on unsupported devices
This commit is contained in:
@@ -13,6 +13,7 @@ const isTv = userAgent.includes('smart-tv') || userAgent.includes('smarttv') ||
|
||||
const isVr = window.navigator.userAgent.includes('VR') && window.navigator.userAgent.includes('OculusBrowser');
|
||||
const browserHasTouchSupport = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
||||
const userAgentHasTouchSupport = !isTv && !isVr && browserHasTouchSupport;
|
||||
const supportMkb = AppInterface || !userAgent.match(/(android|iphone|ipad)/);
|
||||
|
||||
export const STATES: BxStates = {
|
||||
supportedRegion: true,
|
||||
@@ -35,6 +36,7 @@ export const STATES: BxStates = {
|
||||
isTv: isTv,
|
||||
capabilities: {
|
||||
touch: userAgentHasTouchSupport,
|
||||
mkb: supportMkb,
|
||||
}
|
||||
},
|
||||
|
||||
|
@@ -393,10 +393,7 @@ export class GlobalSettingsStorage extends BaseSettingsStorage {
|
||||
requiredVariants: 'full',
|
||||
label: t('enable-mkb'),
|
||||
default: false,
|
||||
unsupported: ((): string | boolean => {
|
||||
const userAgent = ((window.navigator as any).orgUserAgent || window.navigator.userAgent || '').toLowerCase();
|
||||
return !AppInterface && userAgent.match(/(android|iphone|ipad)/) ? t('browser-unsupported-feature') : false;
|
||||
})(),
|
||||
unsupported: !STATES.userAgent.capabilities.mkb,
|
||||
ready: (setting: SettingDefinition) => {
|
||||
let note;
|
||||
let url;
|
||||
|
Reference in New Issue
Block a user