From d11f336bb0d80125ffec3efc9eb5435bf54dd69f Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sun, 9 May 2021 03:11:45 +0300 Subject: [PATCH] [Perf] Disable mask image even on iOS --- src/components/middle/MiddleColumn.tsx | 4 ++-- src/util/environment.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/middle/MiddleColumn.tsx b/src/components/middle/MiddleColumn.tsx index 524119f9..1595610f 100644 --- a/src/components/middle/MiddleColumn.tsx +++ b/src/components/middle/MiddleColumn.tsx @@ -16,7 +16,7 @@ import { ANIMATION_LEVEL_MAX, ANIMATION_END_DELAY, } from '../../config'; -import { IS_MOBILE_SCREEN, IS_TOUCH_ENV, MASK_IMAGE_ENABLED } from '../../util/environment'; +import { IS_MOBILE_SCREEN, IS_TOUCH_ENV, MASK_IMAGE_DISABLED } from '../../util/environment'; import { DropAreaState } from './composer/DropArea'; import { selectChat, @@ -173,7 +173,7 @@ const MiddleColumn: FC = ({ customBackground && !isCustomBackgroundColor && 'custom-bg-image', customBackground && isCustomBackgroundColor && 'custom-bg-color', customBackground && isBackgroundBlurred && 'blurred', - MASK_IMAGE_ENABLED ? 'mask-image-enabled' : 'mask-image-disabled', + MASK_IMAGE_DISABLED ? 'mask-image-disabled' : 'mask-image-enabled', ); const messagingDisabledClassName = buildClassName( diff --git a/src/util/environment.ts b/src/util/environment.ts index 71e48697..5f20f2d6 100644 --- a/src/util/environment.ts +++ b/src/util/environment.ts @@ -50,8 +50,7 @@ export const IS_OPUS_SUPPORTED = Boolean((new Audio()).canPlayType('audio/ogg; c export const DPR = window.devicePixelRatio || 1; -// `mask-image` CSS property for custom background slows down the scroll performance significantly -export const MASK_IMAGE_ENABLED = IS_IOS; +export const MASK_IMAGE_DISABLED = true; let isWebpSupportedCache: boolean | undefined;