diff --git a/web/src/utils/utils.ts b/web/src/utils/utils.ts index b6f1442..90aeba3 100644 --- a/web/src/utils/utils.ts +++ b/web/src/utils/utils.ts @@ -100,14 +100,14 @@ export function getRandomInt(min: number, max: number, ignore?: number) { } export function fixNotchIPhoneHeight() { + if (!('standalone' in window.navigator && window.navigator.standalone)) + return; const computeStyle = getComputedStyle(document.documentElement); const sat = computeStyle.getPropertyValue('--sat') || '0'; const sal = computeStyle.getPropertyValue('--sal') || '0'; const sar = computeStyle.getPropertyValue('--sar') || '0'; const sab = computeStyle.getPropertyValue('--sab') || '0'; alert(`哈哈哈哈 ${sat}-${sal}-${sar}-${sab}`); - if (!isInStandaloneMode || !isIOS) return; - alert(`哈哈哈哈 1`); console.log('computeStyle --sat', sat); console.log('computeStyle --sal', sal); console.log('computeStyle --sar', sar);