fix(ags): fix types of mpris
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
2f372718fb
commit
895f430994
3 changed files with 4 additions and 9 deletions
|
@ -274,7 +274,7 @@ const PlayerButton = ({
|
||||||
colors: Variable<Colors>
|
colors: Variable<Colors>
|
||||||
children: Label[] | Icon[]
|
children: Label[] | Icon[]
|
||||||
onClick: keyof Mpris.Player
|
onClick: keyof Mpris.Player
|
||||||
prop: string
|
prop: keyof Mpris.Player
|
||||||
}) => {
|
}) => {
|
||||||
let hovered = false;
|
let hovered = false;
|
||||||
const stack = new Stack({ children });
|
const stack = new Stack({ children });
|
||||||
|
@ -284,8 +284,7 @@ const PlayerButton = ({
|
||||||
|
|
||||||
child: stack,
|
child: stack,
|
||||||
|
|
||||||
// @ts-expect-error FIXME
|
onButtonReleaseEvent: () => (player[onClick] as () => void)(),
|
||||||
onButtonReleaseEvent: () => player[onClick](),
|
|
||||||
|
|
||||||
onHover: () => {
|
onHover: () => {
|
||||||
hovered = true;
|
hovered = true;
|
||||||
|
@ -323,16 +322,12 @@ const PlayerButton = ({
|
||||||
},
|
},
|
||||||
|
|
||||||
setup: (self) => {
|
setup: (self) => {
|
||||||
// @ts-expect-error FIXME
|
if (player[prop] && (player[prop] as boolean) !== false) {
|
||||||
if (player[prop] && player[prop] !== false) {
|
|
||||||
// @ts-expect-error FIXME
|
|
||||||
stack.shown = String(player[prop]);
|
stack.shown = String(player[prop]);
|
||||||
}
|
}
|
||||||
|
|
||||||
player.connect(`notify::${kebabify(prop)}`, () => {
|
player.connect(`notify::${kebabify(prop)}`, () => {
|
||||||
// @ts-expect-error FIXME
|
|
||||||
if (player[prop] !== 0) {
|
if (player[prop] !== 0) {
|
||||||
// @ts-expect-error FIXME
|
|
||||||
stack.shown = String(player[prop]);
|
stack.shown = String(player[prop]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -476,7 +471,7 @@ export const PreviousButton = (
|
||||||
})),
|
})),
|
||||||
],
|
],
|
||||||
onClick: 'previous',
|
onClick: 'previous',
|
||||||
prop: 'canGoPrev',
|
prop: 'canGoPrevious',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const NextButton = (
|
export const NextButton = (
|
Loading…
Add table
Reference in a new issue