From b43eab4ccbbdc5fa6b2acd82a71c081aa9831ce4 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 14 Dec 2021 22:40:57 +0400 Subject: [PATCH] Auth QR Code: Fix loading default lang pack --- src/components/auth/Auth.scss | 8 +++----- src/components/auth/AuthQrCode.tsx | 7 +++++++ src/util/fallbackLangPack.ts | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/auth/Auth.scss b/src/components/auth/Auth.scss index 55a311edf..fccb79129 100644 --- a/src/components/auth/Auth.scss +++ b/src/components/auth/Auth.scss @@ -2,16 +2,14 @@ width: 100%; max-width: 25.5rem; margin: 0 auto; - padding: 1rem; - padding-top: 6rem; + padding: 6rem 1rem 1rem; text-align: center; @media (min-width: 600px) and (min-height: 450px) { - padding: 1.5rem; - padding-top: 6.8rem; + padding: 6.8rem 1.5rem 1.5rem; &.qr { - padding-top: 5rem; + padding-top: 4rem; } } diff --git a/src/components/auth/AuthQrCode.tsx b/src/components/auth/AuthQrCode.tsx index 632ea4d54..da8ec129e 100644 --- a/src/components/auth/AuthQrCode.tsx +++ b/src/components/auth/AuthQrCode.tsx @@ -7,6 +7,7 @@ import { withGlobal } from '../../lib/teact/teactn'; import { GlobalState, GlobalActions } from '../../global/types'; import { LangCode } from '../../types'; +import { DEFAULT_LANG_CODE } from '../../config'; import { pick } from '../../util/iteratees'; import { setLanguage } from '../../util/langProvider'; import renderText from '../common/helpers/renderText'; @@ -61,6 +62,12 @@ const AuthCode: FC = ({ }, container); }, [connectionState, authQrCode]); + useEffect(() => { + if (connectionState === 'connectionStateReady') { + void setLanguage(DEFAULT_LANG_CODE); + } + }, [connectionState]); + const handleLangChange = useCallback(() => { markIsLoading(); diff --git a/src/util/fallbackLangPack.ts b/src/util/fallbackLangPack.ts index 2d077a06b..1e05956d1 100644 --- a/src/util/fallbackLangPack.ts +++ b/src/util/fallbackLangPack.ts @@ -1771,7 +1771,7 @@ export default { }, 'Login.QR.Help2': { key: 'Login.QR.Help2', - value: 'Go to **Settings** > **Devices** > **Scan QR**', + value: 'Go to **Settings** > **Devices** > **Link Desktop Device**', }, 'Login.QR.Help3': { key: 'Login.QR.Help3',