mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
Load settings before rendering the app
Change-type: patch
This commit is contained in:
parent
6fcd9e1595
commit
571a3533fb
@ -336,6 +336,16 @@ window.addEventListener('touchstart', extendLock);
|
||||
// Initial update lock acquisition
|
||||
extendLock();
|
||||
|
||||
settings.load().catch(exceptionReporter.report);
|
||||
async function main(): Promise<void> {
|
||||
try {
|
||||
await settings.load();
|
||||
} catch (error) {
|
||||
exceptionReporter.report(error);
|
||||
}
|
||||
ReactDOM.render(
|
||||
React.createElement(MainPage),
|
||||
document.getElementById('main'),
|
||||
);
|
||||
}
|
||||
|
||||
ReactDOM.render(React.createElement(MainPage), document.getElementById('main'));
|
||||
main();
|
||||
|
@ -37,9 +37,8 @@ export class FeaturedProject extends React.Component<
|
||||
this.state = { endpoint: null };
|
||||
}
|
||||
|
||||
public async componentDidMount() {
|
||||
public componentDidMount() {
|
||||
try {
|
||||
await settings.load();
|
||||
const endpoint =
|
||||
settings.get('featuredProjectEndpoint') ||
|
||||
'https://assets.balena.io/etcher-featured/index.html';
|
||||
|
Loading…
x
Reference in New Issue
Block a user