Fix tor loading and add highres animations on android

This commit is contained in:
Reckless_Satoshi 2023-02-20 13:56:07 -08:00
parent 766666f8ef
commit 7fb6319d20
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
5 changed files with 30 additions and 18 deletions

View File

@ -108,6 +108,7 @@ const Onboarding = ({
<LinearProgress sx={{ height: '0.7em' }} />
) : (
<TokenInput
autoFocusTarget='copyButton'
inputToken={inputToken}
setInputToken={setInputToken}
setRobot={setRobot}

View File

@ -1,21 +1,8 @@
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
Button,
Collapse,
Grid,
IconButton,
TextField,
Tooltip,
Typography,
useTheme,
} from '@mui/material';
import { useParams } from 'react-router-dom';
import { Page } from '../NavBar';
import { IconButton, TextField, Tooltip, useTheme } from '@mui/material';
import { Robot } from '../../models';
import { Casino, Download, ContentCopy, SmartToy, Bolt } from '@mui/icons-material';
import RobotAvatar from '../../components/RobotAvatar';
import { Download, ContentCopy } from '@mui/icons-material';
import { systemClient } from '../../services/System';
import { saveAsJson } from '../../utils';
@ -26,6 +13,7 @@ interface TokenInputProps {
fullWidth?: boolean;
setRobot: (state: Robot) => 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<boolean>(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 ? (
<Tooltip open={showCopied} title={t('Copied!')}>
<IconButton
autoFocus={autoFocusTarget == 'copyButton' ? true : false}
color={robot.copiedToken ? 'inherit' : 'primary'}
onClick={() => {
systemClient.copyToClipboard(inputToken);

View File

@ -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 (
<Paper
elevation={12}

File diff suppressed because one or more lines are too long

View File

@ -46,6 +46,18 @@ const configMobile: Configuration = {
async: true,
},
},
{
test: path.resolve(__dirname, 'src/components/RobotAvatar/placeholder.json'),
loader: 'file-replace-loader',
options: {
condition: 'if-replacement-exists',
replacement: path.resolve(
__dirname,
'src/components/RobotAvatar/placeholder_highres.json',
),
async: true,
},
},
],
},
plugins: [