fix: add fallback for viewport height on mobile (#1766)

This commit is contained in:
Aman Harwara
2022-10-07 15:41:45 +05:30
committed by GitHub
parent 8de6023848
commit 1e3acd50e9
3 changed files with 16 additions and 9 deletions

View File

@@ -28,6 +28,7 @@ import { ArchiveManager, AutolockService, IOService, WebAlertService, ThemeManag
import { MobileWebReceiver } from './MobileWebReceiver'
import { AndroidBackHandler } from '@/NativeMobileWeb/AndroidBackHandler'
import { PrefDefaults } from '@/Constants/PrefDefaults'
import { setViewportHeightWithFallback } from '@/App'
type WebServices = {
viewControllerManager: ViewControllerManager
@@ -233,8 +234,9 @@ export class WebApplication extends SNApplication implements WebApplicationInter
await this.lockApplicationAfterMobileEventIfApplicable()
}
// eslint-disable-next-line @typescript-eslint/no-empty-function
async handleMobileGainingFocusEvent(): Promise<void> {}
async handleMobileGainingFocusEvent(): Promise<void> {
setViewportHeightWithFallback()
}
async handleMobileLosingFocusEvent(): Promise<void> {
if (this.protections.getMobileScreenshotPrivacyEnabled()) {
@@ -248,6 +250,8 @@ export class WebApplication extends SNApplication implements WebApplicationInter
if (this.protections.getMobileScreenshotPrivacyEnabled()) {
this.mobileDevice().hideMobileInterfaceFromScreenshots()
}
setViewportHeightWithFallback()
}
private async lockApplicationAfterMobileEventIfApplicable(): Promise<void> {