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: [
|
||||
[Mpris, (overlay, busName) => {
|
||||
if (!busName || overlay._players.has(busName))
|
||||
if (overlay._players.has(busName))
|
||||
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);
|
||||
player.colors = Variable();
|
||||
overlay._players.set(busName, PlayerBox(player));
|
||||
|
|
Loading…
Reference in a new issue