From 7fb6319d2058b11c0651bb80dcf17be05dcfab3c Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Mon, 20 Feb 2023 13:56:07 -0800 Subject: [PATCH] Fix tor loading and add highres animations on android --- frontend/src/basic/RobotPage/Onboarding.tsx | 1 + frontend/src/basic/RobotPage/TokenInput.tsx | 23 +++++-------------- frontend/src/basic/RobotPage/index.tsx | 2 +- .../RobotAvatar/placeholder_highres.json | 10 ++++++++ frontend/webpack.config.ts | 12 ++++++++++ 5 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 frontend/src/components/RobotAvatar/placeholder_highres.json diff --git a/frontend/src/basic/RobotPage/Onboarding.tsx b/frontend/src/basic/RobotPage/Onboarding.tsx index aacfe730..a445ced5 100644 --- a/frontend/src/basic/RobotPage/Onboarding.tsx +++ b/frontend/src/basic/RobotPage/Onboarding.tsx @@ -108,6 +108,7 @@ const Onboarding = ({ ) : ( void; inputToken: string; + autoFocusTarget?: 'textfield' | 'copyButton' | 'none'; onPressEnter: () => void; badRequest: string | undefined; setInputToken: (state: string) => void; @@ -42,12 +30,12 @@ const TokenInput = ({ showDownload = false, fullWidth = true, onPressEnter, + autoFocusTarget = 'textfield', inputToken, badRequest, setInputToken, }: TokenInputProps): JSX.Element => { const { t } = useTranslation(); - const theme = useTheme(); const [showCopied, setShowCopied] = useState(false); const createJsonFile = () => { return { @@ -66,7 +54,7 @@ const TokenInput = ({ required={true} label={label ? label : undefined} value={inputToken} - autoFocus + autoFocus={autoFocusTarget == 'texfield' ? true : false} fullWidth={fullWidth} sx={{ borderColor: 'primary' }} variant={editable ? 'outlined' : 'filled'} @@ -93,6 +81,7 @@ const TokenInput = ({ endAdornment: showCopy ? ( { systemClient.copyToClipboard(inputToken); diff --git a/frontend/src/basic/RobotPage/index.tsx b/frontend/src/basic/RobotPage/index.tsx index 903b11d7..b9af4dd6 100644 --- a/frontend/src/basic/RobotPage/index.tsx +++ b/frontend/src/basic/RobotPage/index.tsx @@ -152,7 +152,7 @@ const RobotPage = ({ setTimeout(() => setRobot(new Robot()), 10); }; - if (window?.NativeRobosats & (torStatus != 'DONE')) { + if (!(window.NativeRobosats === undefined) && !(torStatus == 'DONE' || torStatus == '"Done"')) { return (