mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-22 05:39:20 +01:00
Handle errors here
This commit is contained in:
parent
d981a31a10
commit
eb3880b435
1 changed files with 13 additions and 7 deletions
|
@ -58,13 +58,19 @@ function Compose({
|
||||||
).info;
|
).info;
|
||||||
|
|
||||||
const configuration = useMemo(() => {
|
const configuration = useMemo(() => {
|
||||||
const instances = store.local.getJSON('instances');
|
try {
|
||||||
const currentInstance = accounts.find(
|
const instances = store.local.getJSON('instances');
|
||||||
(a) => a.info.id === currentAccount,
|
const currentInstance = accounts.find(
|
||||||
).instanceURL;
|
(a) => a.info.id === currentAccount,
|
||||||
const config = instances[currentInstance].configuration;
|
).instanceURL;
|
||||||
console.log(config);
|
const config = instances[currentInstance].configuration;
|
||||||
return config;
|
console.log(config);
|
||||||
|
return config;
|
||||||
|
} catch (e) {
|
||||||
|
alert('Failed to load instance configuration. Please try again.');
|
||||||
|
console.error(e);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
Loading…
Reference in a new issue