Removed update when clicking on a game and fixed sorting

This commit is contained in:
mag1yar 2024-05-16 19:26:45 +05:00
parent 3cbbb71768
commit 28bd70e745

View file

@ -91,20 +91,20 @@ export class WindowManager {
where: { where: {
isDeleted: false, isDeleted: false,
executablePath: Not(IsNull()), executablePath: Not(IsNull()),
lastTimePlayed: Not(IsNull()),
}, },
take: 5, take: 5,
order: { order: {
lastTimePlayed: "DESC", updatedAt: "DESC",
}, },
}); });
const recentlyPlayedGames: Array<MenuItemConstructorOptions | MenuItem> = const recentlyPlayedGames: Array<MenuItemConstructorOptions | MenuItem> =
games.map(({ title, id, executablePath }) => ({ games.map(({ title, executablePath }) => ({
label: title, label: title,
type: "normal", type: "normal",
click: async () => { click: async () => {
if (!executablePath) return; if (!executablePath) return;
await gameRepository.update({ id }, { executablePath });
shell.openPath(executablePath); shell.openPath(executablePath);
}, },