Handle errors here
This commit is contained in:
parent
d981a31a10
commit
eb3880b435
|
@ -58,6 +58,7 @@ function Compose({
|
|||
).info;
|
||||
|
||||
const configuration = useMemo(() => {
|
||||
try {
|
||||
const instances = store.local.getJSON('instances');
|
||||
const currentInstance = accounts.find(
|
||||
(a) => a.info.id === currentAccount,
|
||||
|
@ -65,6 +66,11 @@ function Compose({
|
|||
const config = instances[currentInstance].configuration;
|
||||
console.log(config);
|
||||
return config;
|
||||
} catch (e) {
|
||||
alert('Failed to load instance configuration. Please try again.');
|
||||
console.error(e);
|
||||
return {};
|
||||
}
|
||||
}, []);
|
||||
|
||||
const {
|
||||
|
|
Loading…
Reference in a new issue