mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2025-10-10 04:41:55 +05:30
fix: crashing when no focused client is available
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { createBinding, createComputed } from "ags";
|
||||
import { createBinding, createComputed, With } from "ags";
|
||||
import { Gdk, Gtk } from "ags/gtk4";
|
||||
import AstalHyprland from "gi://AstalHyprland";
|
||||
|
||||
@@ -48,8 +48,10 @@ export const FocusedClient = () => {
|
||||
const focused = createBinding(hyprland, "focusedClient");
|
||||
|
||||
return (
|
||||
<box cssClasses={["focused-client"]} visible={focused.as(Boolean)}>
|
||||
<label label={focused((client) => client.title)} />
|
||||
<box cssClasses={["focused-client"]}>
|
||||
<With value={focused}>
|
||||
{(client) => client && <label label={createBinding(client, "title")} />}
|
||||
</With>
|
||||
</box>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user