bar: catch async errors

This commit is contained in:
end-4
2024-04-06 09:55:50 +07:00
parent 1ce8cfdf49
commit 373e448ba5
+5 -1
View File
@@ -27,6 +27,10 @@ function forMonitors(widget) {
const n = Gdk.Display.get_default()?.get_n_monitors() || 1;
return range(n, 0).map(widget).flat(1);
}
function forMonitorsAsync(widget) {
const n = Gdk.Display.get_default()?.get_n_monitors() || 1;
return range(n, 0).forEach((n) => widget().catch(print))
}
// SCSS compilation
Utils.exec(`bash -c 'echo "" > ${App.configDir}/scss/_musicwal.scss'`); // reset music styles
@@ -74,6 +78,6 @@ App.config({
});
// Stuff that don't need to be toggled. And they're async so ugh...
forMonitors(Bar);
forMonitorsAsync(Bar);
// Bar().catch(print); // Use this to debug the bar. Single monitor only.