From a3452d9f58a53ceae75ec132123737415ea953d0 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 4 Feb 2022 15:18:54 +0100 Subject: [PATCH] UI Loader: Preload reaction thumbs --- src/components/common/AnimatedSticker.tsx | 4 ++-- src/components/common/UiLoader.tsx | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/common/AnimatedSticker.tsx b/src/components/common/AnimatedSticker.tsx index cf3271bbe..c2df90f16 100644 --- a/src/components/common/AnimatedSticker.tsx +++ b/src/components/common/AnimatedSticker.tsx @@ -29,8 +29,8 @@ type RLottieInstance = import('../../lib/rlottie/RLottie').default; let lottiePromise: Promise; let RLottie: RLottieClass; -// Time supposed for judges to measure "Transferred Size" in Dev Tools -const LOTTIE_LOAD_DELAY = 5000; +// Time for the main interface to completely load +const LOTTIE_LOAD_DELAY = 3000; async function ensureLottie() { if (!lottiePromise) { diff --git a/src/components/common/UiLoader.tsx b/src/components/common/UiLoader.tsx index cd81ca5cb..35f6b5160 100644 --- a/src/components/common/UiLoader.tsx +++ b/src/components/common/UiLoader.tsx @@ -19,6 +19,8 @@ import './UiLoader.scss'; // @ts-ignore import telegramLogoPath from '../../assets/telegram-logo.svg'; // @ts-ignore +import reactionThumbsPath from '../../assets/reaction-thumbs.png'; +// @ts-ignore import monkeyPath from '../../assets/monkey.svg'; import { selectIsRightColumnShown, selectTheme } from '../../modules/selectors'; @@ -66,6 +68,7 @@ const preloadTasks = { loadModule(Bundles.Main, 'Main') .then(preloadFonts), preloadAvatars(), + preloadImage(reactionThumbsPath), ]), authPhoneNumber: () => Promise.all([ preloadFonts(),