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