Merge pull request #1629 from hydralauncher/fix/order-of-games-on-system-tray

fix: correctly sorting games on System Tray
This commit is contained in:
Zamitto
2025-04-28 22:38:40 -03:00
committed by GitHub
3 changed files with 11 additions and 4 deletions

View File

@@ -100,9 +100,16 @@ jobs:
GITHUB_ACTOR: ${{ github.actor }} GITHUB_ACTOR: ${{ github.actor }}
run: node scripts/upload-build.cjs run: node scripts/upload-build.cjs
- name: Get package-json version
id: get-version
uses: beaconbrigade/package-json-version@v0.3.2
with:
path: .
- name: Release - name: Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
tag_name: v${{ steps.get-version.outputs.version }}
draft: true draft: true
files: | files: |
dist/*.exe dist/*.exe

View File

@@ -1,6 +1,6 @@
{ {
"name": "hydralauncher", "name": "hydralauncher",
"version": "3.4.5", "version": "3.4.6",
"description": "Hydra", "description": "Hydra",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "Los Broxas", "author": "Los Broxas",

View File

@@ -16,7 +16,7 @@ import trayIcon from "@resources/tray-icon.png?asset";
import { HydraApi } from "./hydra-api"; import { HydraApi } from "./hydra-api";
import UserAgent from "user-agents"; import UserAgent from "user-agents";
import { db, gamesSublevel, levelKeys } from "@main/level"; 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 type { ScreenState, UserPreferences } from "@types";
import { AuthPage } from "@shared"; import { AuthPage } from "@shared";
import { isStaging } from "@main/constants"; import { isStaging } from "@main/constants";
@@ -370,9 +370,9 @@ export class WindowManager {
!game.isDeleted && game.executablePath && game.lastTimePlayed !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<MenuItemConstructorOptions | MenuItem> = const recentlyPlayedGames: Array<MenuItemConstructorOptions | MenuItem> =