mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: updating play label on hero panel
This commit is contained in:
parent
f1bdec484e
commit
7d675f6acf
40 changed files with 2049 additions and 745 deletions
|
@ -46,7 +46,9 @@ export const startProcessWatcher = async () => {
|
|||
const zero = gamesPlaytime.get(game.id);
|
||||
const delta = performance.now() - zero;
|
||||
|
||||
WindowManager.mainWindow.webContents.send("on-playtime", game.id);
|
||||
if (WindowManager.mainWindow) {
|
||||
WindowManager.mainWindow.webContents.send("on-playtime", game.id);
|
||||
}
|
||||
|
||||
await gameRepository.update(game.id, {
|
||||
playTimeInMilliseconds: game.playTimeInMilliseconds + delta,
|
||||
|
@ -68,7 +70,9 @@ export const startProcessWatcher = async () => {
|
|||
|
||||
if (gamesPlaytime.has(game.id)) {
|
||||
gamesPlaytime.delete(game.id);
|
||||
WindowManager.mainWindow.webContents.send("on-game-close", game.id);
|
||||
if (WindowManager.mainWindow) {
|
||||
WindowManager.mainWindow.webContents.send("on-game-close", game.id);
|
||||
}
|
||||
}
|
||||
|
||||
await sleep(sleepTime);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue