mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 12:11:35 +00:00
Android minor fixes (#285)
* Android mino fixes * Avatar tooltip position * format
This commit is contained in:
parent
57f9b6447d
commit
7c52c90866
@ -15,6 +15,7 @@ interface Props {
|
||||
statusColor?: 'primary' | 'secondary' | 'default' | 'error' | 'info' | 'success' | 'warning';
|
||||
orderType?: number;
|
||||
tooltip?: string;
|
||||
tooltipPosition?: string;
|
||||
avatarClass?: string;
|
||||
onLoad?: () => void;
|
||||
}
|
||||
@ -24,6 +25,7 @@ const RobotAvatar: React.FC<Props> = ({
|
||||
orderType,
|
||||
statusColor,
|
||||
tooltip,
|
||||
tooltipPosition = 'right',
|
||||
smooth = false,
|
||||
flipHorizontally = false,
|
||||
style = {},
|
||||
@ -124,7 +126,7 @@ const RobotAvatar: React.FC<Props> = ({
|
||||
};
|
||||
|
||||
return tooltip ? (
|
||||
<Tooltip placement='right' enterTouchDelay={0} title={tooltip}>
|
||||
<Tooltip placement={tooltipPosition} enterTouchDelay={0} title={tooltip}>
|
||||
{getAvatarWithBadges()}
|
||||
</Tooltip>
|
||||
) : (
|
||||
|
@ -51,8 +51,8 @@ class UserGenPage extends Component {
|
||||
});
|
||||
} else if (window.NativeRobosats && systemClient.getCookie('robot_token')) {
|
||||
const token = systemClient.getCookie('robot_token');
|
||||
this.props.setAppState({ token });
|
||||
this.setState({ token, loadingRobot: false });
|
||||
this.setState({ token });
|
||||
this.getGeneratedUser(token);
|
||||
} else {
|
||||
const newToken = genBase62Token(36);
|
||||
this.setState({
|
||||
@ -245,6 +245,7 @@ class UserGenPage extends Component {
|
||||
width: `${201 * fontSizeFactor}px`,
|
||||
}}
|
||||
tooltip={t('This is your trading avatar')}
|
||||
tooltipPosition='up'
|
||||
/>
|
||||
<br />
|
||||
</Grid>
|
||||
|
@ -1,5 +1,5 @@
|
||||
export { default as LimitList } from './Limit.model';
|
||||
export { Limit } from './Limit.model';
|
||||
export { default as Maker } from './Maker.model';
|
||||
export { defaultMaker as defaultMaker } from './Maker.model';
|
||||
export { default as Order } from './Order.model';
|
||||
export type { LimitList } from './Limit.model';
|
||||
export type { Limit } from './Limit.model';
|
||||
export type { Maker } from './Maker.model';
|
||||
export { defaultMaker } from './Maker.model';
|
||||
export type { Order } from './Order.model';
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { ApiClient } from '../api';
|
||||
import { systemClient } from '../../System';
|
||||
import NativeRobosats from '../../Native';
|
||||
|
||||
class ApiNativeClient implements ApiClient {
|
||||
private assetsCache: { [path: string]: string } = {};
|
||||
@ -11,9 +10,9 @@ class ApiNativeClient implements ApiClient {
|
||||
'Content-Type': 'application/json',
|
||||
};
|
||||
|
||||
const sessionid = systemClient.getCookie('sessionid');
|
||||
if (sessionid) {
|
||||
const robotToken = systemClient.getCookie('robot_token');
|
||||
const robotToken = systemClient.getCookie('robot_token');
|
||||
if (robotToken) {
|
||||
const sessionid = systemClient.getCookie('sessionid');
|
||||
const csrftoken = systemClient.getCookie('csrftoken');
|
||||
const pubKey = systemClient.getCookie('pub_key');
|
||||
|
||||
|
@ -37,9 +37,9 @@ const App = () => {
|
||||
});
|
||||
};
|
||||
|
||||
loadCookie('sessionid');
|
||||
EncryptedStorage.removeItem('sessionid');
|
||||
EncryptedStorage.removeItem('csrftoken');
|
||||
loadCookie('robot_token');
|
||||
loadCookie('csrftoken');
|
||||
loadCookie('pub_key');
|
||||
loadCookie('enc_priv_key').then(() => injectMessageResolve(reponseId));
|
||||
};
|
||||
@ -113,7 +113,14 @@ const App = () => {
|
||||
if (state.isInternetReachable) {
|
||||
try {
|
||||
daemonStatus = await torClient.daemon.getDaemonStatus();
|
||||
} catch {}
|
||||
if (daemonStatus === 'NOTINIT') {
|
||||
await torClient.reset();
|
||||
return sendTorStatus();
|
||||
}
|
||||
} catch {
|
||||
await torClient.reset();
|
||||
return sendTorStatus();
|
||||
}
|
||||
}
|
||||
|
||||
injectMessage({
|
||||
|
@ -20,6 +20,12 @@ class TorClient {
|
||||
}
|
||||
};
|
||||
|
||||
public reset: () => void = async () => {
|
||||
console.log('Reset TOR');
|
||||
await this.daemon.stopIfRunning();
|
||||
await this.daemon.startIfNotStarted();
|
||||
};
|
||||
|
||||
public get: (path: string, headers: object) => Promise<object> = async (path, headers) => {
|
||||
return await new Promise<object>(async (resolve, reject) => {
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user