Log undefined menu models and action groups. Fix null errors for workspaces and update array property accessors for services. (#583)

* Handle null values for actionGroup.

* Add logs

* more logs

* Fix property accessors and workspace null errors.
This commit is contained in:
Jas Singh
2024-12-21 14:53:26 -08:00
committed by GitHub
parent 006e9543f0
commit da0299f06b
6 changed files with 29 additions and 19 deletions

View File

@@ -24,12 +24,12 @@ const focusedClient = (focusedClient: AstalHyprland.Client): void => {
export const initializeAutoHide = (): void => {
Variable.derive([bind(autoHide), bind(forceUpdater), bind(hyprlandService, 'workspaces')], (shouldAutohide) => {
if (shouldAutohide === 'never') {
hyprlandService.monitors.forEach((monitor) => {
hyprlandService.get_monitors().forEach((monitor) => {
App.get_window(`bar-${monitor.id}`)?.set_visible(true);
});
}
hyprlandService.workspaces.map((workspace) => {
hyprlandService.get_workspaces().map((workspace) => {
if (autoHide.get() === 'single-window') {
App.get_window(`bar-${workspace.monitor.id}`)?.set_visible(workspace.get_clients().length !== 1);
}
@@ -42,7 +42,7 @@ export const initializeAutoHide = (): void => {
Variable.derive([bind(autoHide)], (shouldAutohide) => {
if (shouldAutohide === 'fullscreen') {
hyprlandService.workspaces.forEach((workspace) => {
hyprlandService.get_workspaces().forEach((workspace) => {
App.get_window(`bar-${workspace.monitor.id}`)?.set_visible(!workspace.hasFullscreen);
});
}