From f2bd9df77fb6d435ccf9493b11e8143a24fde16e Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Mon, 28 Apr 2025 21:58:32 -0300 Subject: [PATCH] fix: use orderBy instead of sortBy to correctly sort games on system tray --- src/main/services/window-manager.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/services/window-manager.ts b/src/main/services/window-manager.ts index b3d3ff37..9841eb6e 100644 --- a/src/main/services/window-manager.ts +++ b/src/main/services/window-manager.ts @@ -16,7 +16,7 @@ import trayIcon from "@resources/tray-icon.png?asset"; import { HydraApi } from "./hydra-api"; import UserAgent from "user-agents"; import { db, gamesSublevel, levelKeys } from "@main/level"; -import { slice, sortBy } from "lodash-es"; +import { orderBy, slice } from "lodash-es"; import type { ScreenState, UserPreferences } from "@types"; import { AuthPage } from "@shared"; import { isStaging } from "@main/constants"; @@ -370,9 +370,9 @@ export class WindowManager { !game.isDeleted && game.executablePath && game.lastTimePlayed ); - const sortedGames = sortBy(filteredGames, "lastTimePlayed", "DESC"); + const sortedGames = orderBy(filteredGames, "lastTimePlayed", "desc"); - return slice(sortedGames, 0, 5); + return slice(sortedGames, 0, 6); }); const recentlyPlayedGames: Array =