mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-19 04:31:35 +00:00
Fix setSettings host override
This commit is contained in:
parent
b4072b95da
commit
dccb155cd8
@ -181,7 +181,7 @@ const Main = ({ settings, setSettings }: MainProps): JSX.Element => {
|
|||||||
return await data;
|
return await data;
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchInfo = function (setNetwork?: boolean) {
|
const fetchInfo = function () {
|
||||||
setInfo({ ...info, loading: true });
|
setInfo({ ...info, loading: true });
|
||||||
apiClient.get(baseUrl, '/api/info/').then((data: Info) => {
|
apiClient.get(baseUrl, '/api/info/').then((data: Info) => {
|
||||||
const versionInfo: any = checkVer(data.version.major, data.version.minor, data.version.patch);
|
const versionInfo: any = checkVer(data.version.major, data.version.minor, data.version.patch);
|
||||||
@ -192,19 +192,22 @@ const Main = ({ settings, setSettings }: MainProps): JSX.Element => {
|
|||||||
clientVersion: versionInfo.clientVersion,
|
clientVersion: versionInfo.clientVersion,
|
||||||
loading: false,
|
loading: false,
|
||||||
});
|
});
|
||||||
// Sets Setting network from coordinator API param if accessing via web
|
|
||||||
if (setNetwork) {
|
|
||||||
setSettings({ ...settings, network: data.network });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (open.stats || open.coordinator || info.coordinatorVersion == 'v?.?.?') {
|
if (open.stats || open.coordinator || info.coordinatorVersion == 'v?.?.?') {
|
||||||
fetchInfo(info.coordinatorVersion == 'v?.?.?');
|
fetchInfo();
|
||||||
}
|
}
|
||||||
}, [open.stats, open.coordinator]);
|
}, [open.stats, open.coordinator]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// Sets Setting network from coordinator API param if accessing via web
|
||||||
|
if (settings.network == undefined) {
|
||||||
|
setSettings({ ...settings, network: data.network });
|
||||||
|
}
|
||||||
|
}, [info]);
|
||||||
|
|
||||||
const fetchRobot = function ({ keys = false }) {
|
const fetchRobot = function ({ keys = false }) {
|
||||||
const requestBody = {
|
const requestBody = {
|
||||||
token_sha256: sha256(robot.token),
|
token_sha256: sha256(robot.token),
|
||||||
|
@ -50,6 +50,7 @@ class UnsafeAlert extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
|
console.log(this.state);
|
||||||
|
|
||||||
// If alert is hidden return null
|
// If alert is hidden return null
|
||||||
if (!this.state.show) {
|
if (!this.state.show) {
|
||||||
|
Loading…
Reference in New Issue
Block a user