sidebar: fix dashboard media types
This commit is contained in:
parent
8772a05a90
commit
62b6bd20c5
2 changed files with 5 additions and 5 deletions
|
|
@ -120,7 +120,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.media {
|
||||
.dashboard .media {
|
||||
@include lib.spacing(15);
|
||||
|
||||
.cover-art {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue