sideright: fix assertion row != -1
Idk why but needs a timeout before calendar update
This commit is contained in:
parent
5823a43aaf
commit
31bc49a97a
1 changed files with 8 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { bind } from "astal";
|
import { bind, timeout } from "astal";
|
||||||
import { Astal, Gtk, type Gdk } from "astal/gtk3";
|
import { Astal, Gtk, type Gdk } from "astal/gtk3";
|
||||||
import SWeather, { type WeatherData } from "../../services/weather";
|
import SWeather, { type WeatherData } from "../../services/weather";
|
||||||
import { ellipsize } from "../../utils/strings";
|
import { ellipsize } from "../../utils/strings";
|
||||||
|
|
@ -42,13 +42,14 @@ const Calendar = () => (
|
||||||
<WCal
|
<WCal
|
||||||
hexpand
|
hexpand
|
||||||
showDetails={false}
|
showDetails={false}
|
||||||
day={0}
|
|
||||||
setup={self => {
|
setup={self => {
|
||||||
const update = () => {
|
const update = () =>
|
||||||
const now = new Date();
|
timeout(0.1, () => {
|
||||||
if (self.month === now.getMonth() && self.year === now.getFullYear()) self.day = now.getDate();
|
const now = new Date();
|
||||||
else self.day = 0;
|
if (self.month === now.getMonth() && self.year === now.getFullYear())
|
||||||
};
|
self.day = now.getDate();
|
||||||
|
else self.day = 0;
|
||||||
|
});
|
||||||
self.connect("month-changed", update);
|
self.connect("month-changed", update);
|
||||||
self.connect("next-month", update);
|
self.connect("next-month", update);
|
||||||
self.connect("prev-month", update);
|
self.connect("prev-month", update);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue