mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: game session start time stamp
This commit is contained in:
parent
800e99fda0
commit
188fe4537a
9 changed files with 45 additions and 34 deletions
|
@ -8,6 +8,7 @@ import type {
|
|||
UserPreferences,
|
||||
AppUpdaterEvent,
|
||||
StartGameDownloadPayload,
|
||||
RunningGameEvent,
|
||||
} from "@types";
|
||||
|
||||
contextBridge.exposeInMainWorld("electron", {
|
||||
|
@ -84,9 +85,11 @@ contextBridge.exposeInMainWorld("electron", {
|
|||
ipcRenderer.invoke("deleteGameFolder", gameId),
|
||||
getGameByObjectID: (objectID: string) =>
|
||||
ipcRenderer.invoke("getGameByObjectID", objectID),
|
||||
onGamesRunning: (cb: (gamesId: number[]) => void) => {
|
||||
const listener = (_event: Electron.IpcRendererEvent, gamesId: number[]) =>
|
||||
cb(gamesId);
|
||||
onRunningGames: (cb: (runningGames: RunningGameEvent) => void) => {
|
||||
const listener = (
|
||||
_event: Electron.IpcRendererEvent,
|
||||
runningGames: RunningGameEvent
|
||||
) => cb(runningGames);
|
||||
ipcRenderer.on("on-games-running", listener);
|
||||
return () => ipcRenderer.removeListener("on-games-running", listener);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue