app: catch errors in main
This commit is contained in:
parent
27b12681f6
commit
4d9346e580
1 changed files with 23 additions and 19 deletions
42
app.tsx
42
app.tsx
|
|
@ -65,30 +65,34 @@ App.start({
|
||||||
instanceName: "caelestia",
|
instanceName: "caelestia",
|
||||||
icons: "assets/icons",
|
icons: "assets/icons",
|
||||||
async main() {
|
async main() {
|
||||||
const now = Date.now();
|
try {
|
||||||
|
const now = Date.now();
|
||||||
|
|
||||||
await initConfig();
|
await initConfig();
|
||||||
|
|
||||||
loadStyleAsync().catch(console.error);
|
loadStyleAsync().catch(console.error);
|
||||||
Palette.get_default().connect("notify::colours", () => loadStyleAsync().catch(console.error));
|
Palette.get_default().connect("notify::colours", () => loadStyleAsync().catch(console.error));
|
||||||
Palette.get_default().connect("notify::mode", () => loadStyleAsync().catch(console.error));
|
Palette.get_default().connect("notify::mode", () => loadStyleAsync().catch(console.error));
|
||||||
|
|
||||||
<Launcher />;
|
<Launcher />;
|
||||||
<NotifPopups />;
|
<NotifPopups />;
|
||||||
<Osds />;
|
<Osds />;
|
||||||
<Session />;
|
<Session />;
|
||||||
Monitors.get_default().forEach(m => <SideBar monitor={m} />);
|
Monitors.get_default().forEach(m => <SideBar monitor={m} />);
|
||||||
Monitors.get_default().forEach(m => <Bar monitor={m} />);
|
Monitors.get_default().forEach(m => <Bar monitor={m} />);
|
||||||
Monitors.get_default().forEach(m => <ScreenCorners monitor={m} />);
|
Monitors.get_default().forEach(m => <ScreenCorners monitor={m} />);
|
||||||
|
|
||||||
// Init services
|
// Init services
|
||||||
timeout(1000, () => {
|
timeout(1000, () => {
|
||||||
idle(() => Schemes.get_default());
|
idle(() => Schemes.get_default());
|
||||||
idle(() => Wallpapers.get_default());
|
idle(() => Wallpapers.get_default());
|
||||||
idle(() => Calendar.get_default());
|
idle(() => Calendar.get_default());
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`Caelestia started in ${Date.now() - now}ms`);
|
console.log(`Caelestia started in ${Date.now() - now}ms`);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
requestHandler(request, res) {
|
requestHandler(request, res) {
|
||||||
if (request === "reload-css") loadStyleAsync().catch(console.error);
|
if (request === "reload-css") loadStyleAsync().catch(console.error);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue