sidebar: fix dashboard media types

This commit is contained in:
2 * r + 2 * t 2025-03-26 21:04:26 +11:00
parent 8772a05a90
commit 62b6bd20c5
2 changed files with 5 additions and 5 deletions

View file

@ -120,7 +120,7 @@
}
}
.media {
.dashboard .media {
@include lib.spacing(15);
.cover-art {

View file

@ -58,7 +58,7 @@ const User = () => {
);
};
const Media = ({ player }: { player: AstalMpris.Player }) => {
const Media = ({ player }: { player: AstalMpris.Player | null }) => {
const position = player
? Variable.derive([bind(player, "position"), bind(player, "length")], (p, l) => p / l)
: Variable(0);
@ -84,14 +84,14 @@ const Media = ({ player }: { player: AstalMpris.Player }) => {
hexpand
sensitive={player ? bind(player, "canGoPrevious") : false}
cursor="pointer"
onClicked={() => player.next()}
onClicked={() => player?.next()}
label="󰒮"
/>
<button
hexpand
sensitive={player ? bind(player, "canControl") : false}
cursor="pointer"
onClicked={() => player.play_pause()}
onClicked={() => player?.play_pause()}
label={
player
? bind(player, "playbackStatus").as(s =>
@ -104,7 +104,7 @@ const Media = ({ player }: { player: AstalMpris.Player }) => {
hexpand
sensitive={player ? bind(player, "canGoNext") : false}
cursor="pointer"
onClicked={() => player.next()}
onClicked={() => player?.next()}
label="󰒭"
/>
</box>