fix(ags player): make sure players are init correctly
This commit is contained in:
parent
d719d445be
commit
9c93e3dafd
1 changed files with 9 additions and 1 deletions
|
@ -93,9 +93,17 @@ export default () => Box({
|
||||||
],
|
],
|
||||||
connections: [
|
connections: [
|
||||||
[Mpris, (overlay, busName) => {
|
[Mpris, (overlay, busName) => {
|
||||||
if (!busName || overlay._players.has(busName))
|
if (overlay._players.has(busName))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!busName) {
|
||||||
|
let player = Mpris.players.find(p => !overlay._players.has(p.busName));
|
||||||
|
if (player)
|
||||||
|
busName = player.busName;
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const player = Mpris.getPlayer(busName);
|
const player = Mpris.getPlayer(busName);
|
||||||
player.colors = Variable();
|
player.colors = Variable();
|
||||||
overlay._players.set(busName, PlayerBox(player));
|
overlay._players.set(busName, PlayerBox(player));
|
||||||
|
|
Loading…
Reference in a new issue