diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-29 17:29:02 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-01-29 17:29:02 +1100 |
| commit | 31bc49a97af1037d0c0868be86fb2be91c7a431e (patch) | |
| tree | fd1dba8e7d5aef8d1e1a0ad6c8b7f5144de22b4d /src/modules/popdowns | |
| parent | bar: hide tray when no items (diff) | |
| download | caelestia-shell-31bc49a97af1037d0c0868be86fb2be91c7a431e.tar.gz caelestia-shell-31bc49a97af1037d0c0868be86fb2be91c7a431e.tar.bz2 caelestia-shell-31bc49a97af1037d0c0868be86fb2be91c7a431e.zip | |
sideright: fix assertion row != -1
Idk why but needs a timeout before calendar update
Diffstat (limited to 'src/modules/popdowns')
| -rw-r--r-- | src/modules/popdowns/sideright.tsx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/modules/popdowns/sideright.tsx b/src/modules/popdowns/sideright.tsx index 7dc1688..ac2845a 100644 --- a/src/modules/popdowns/sideright.tsx +++ b/src/modules/popdowns/sideright.tsx @@ -1,4 +1,4 @@ -import { bind } from "astal"; +import { bind, timeout } from "astal"; import { Astal, Gtk, type Gdk } from "astal/gtk3"; import SWeather, { type WeatherData } from "../../services/weather"; import { ellipsize } from "../../utils/strings"; @@ -42,13 +42,14 @@ const Calendar = () => ( <WCal hexpand showDetails={false} - day={0} setup={self => { - const update = () => { - const now = new Date(); - if (self.month === now.getMonth() && self.year === now.getFullYear()) self.day = now.getDate(); - else self.day = 0; - }; + const update = () => + timeout(0.1, () => { + const now = new Date(); + if (self.month === now.getMonth() && self.year === now.getFullYear()) + self.day = now.getDate(); + else self.day = 0; + }); self.connect("month-changed", update); self.connect("next-month", update); self.connect("prev-month", update); |