fix(ags players): make favorite player be first on startup

This commit is contained in:
matt1432 2023-11-01 23:11:39 -04:00
parent fc13e694fb
commit 68962df0b8
2 changed files with 4 additions and 5 deletions

View file

@ -90,6 +90,7 @@
]) ++ ]) ++
(with pkgs; [ (with pkgs; [
comma
dracula-theme dracula-theme
neofetch neofetch
progress progress

View file

@ -130,13 +130,11 @@ export default () => Box({
overlay.overlays = result; overlay.overlays = result;
// Select favorite player at startup // Select favorite player at startup
if (!overlay._setup) { if (!overlay._setup && overlay._players.has(FAVE_PLAYER)) {
if (overlay._players.has(FAVE_PLAYER))
overlay.reorder_overlay(overlay._players.get(FAVE_PLAYER), -1); overlay.reorder_overlay(overlay._players.get(FAVE_PLAYER), -1);
overlay._setup = true; overlay._setup = true;
} }
else { else if (overlay._players.get(previousFirst)) {
overlay.reorder_overlay(overlay._players.get(previousFirst), -1); overlay.reorder_overlay(overlay._players.get(previousFirst), -1);
} }
}, 'player-added'], }, 'player-added'],