mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-19 04:31:35 +00:00
Fix avatar loading issues
This commit is contained in:
parent
cafc63bc05
commit
b4205761fe
@ -112,7 +112,7 @@ const Main = ({ settings, setSettings }: MainProps): JSX.Element => {
|
||||
coordinatorVersion: versionInfo.coordinatorVersion,
|
||||
clientVersion: versionInfo.clientVersion,
|
||||
});
|
||||
if (!robot.nickname && data.nickname) {
|
||||
if (!robot.nickname && data.nickname && !robot.loading) {
|
||||
setRobot({
|
||||
...robot,
|
||||
nickname: data.nickname,
|
||||
|
@ -44,7 +44,9 @@ class UserGenPage extends Component {
|
||||
componentDidMount() {
|
||||
// Checks in parent HomePage if there is already a nick and token
|
||||
// Displays the existing one
|
||||
if (this.props.robot.token) {
|
||||
if (this.props.robot.nickname != null) {
|
||||
this.setState({ inputToken: this.props.robot.token });
|
||||
} else if (this.props.robot.token) {
|
||||
this.setState({ inputToken: this.props.robot.token });
|
||||
this.getGeneratedUser(this.props.robot.token);
|
||||
} else {
|
||||
@ -80,6 +82,7 @@ class UserGenPage extends Component {
|
||||
? this.props.setRobot({
|
||||
...this.props.robot,
|
||||
avatarLoaded: true,
|
||||
loading: false,
|
||||
nickname: data.nickname ?? this.props.robot.nickname,
|
||||
activeOrderId: data.active_order_id ?? null,
|
||||
referralCode: data.referral_code ?? this.props.referralCode,
|
||||
@ -91,6 +94,7 @@ class UserGenPage extends Component {
|
||||
...this.props.robot,
|
||||
nickname: data.nickname,
|
||||
token: token,
|
||||
loading: false,
|
||||
activeOrderId: data.active_order_id ? data.active_order_id : null,
|
||||
lastOrderId: data.last_order_id ? data.last_order_id : null,
|
||||
referralCode: data.referral_code,
|
||||
|
@ -110,18 +110,18 @@ class UnsafeAlert extends Component {
|
||||
<Alert severity='warning' sx={{ maxHeight: '120px' }}>
|
||||
<AlertTitle>{t('You are not using RoboSats privately')}</AlertTitle>
|
||||
<Trans i18nKey='phone_unsafe_alert'>
|
||||
You will not be able to complete a trade. Use{' '}
|
||||
<a>You will not be able to complete a trade. Use </a>
|
||||
<Link href='https://www.torproject.org/download/' target='_blank'>
|
||||
Tor Browser
|
||||
</Link>{' '}
|
||||
and visit the{' '}
|
||||
</Link>
|
||||
<a> and visit the </a>
|
||||
<Link
|
||||
href='http://robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion'
|
||||
target='_blank'
|
||||
>
|
||||
Onion
|
||||
</Link>{' '}
|
||||
site.
|
||||
<a> site.</a>
|
||||
</Trans>
|
||||
<div style={{ width: '100%' }}></div>
|
||||
<div align='center'>
|
||||
|
@ -41,7 +41,7 @@ export const defaultRobot: Robot = {
|
||||
tgEnabled: false,
|
||||
tgBotName: 'unknown',
|
||||
tgToken: 'unknown',
|
||||
loading: true,
|
||||
loading: false,
|
||||
avatarLoaded: false,
|
||||
copiedToken: false,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user