mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2025-09-19 10:09:28 +02:00
feat: reworked the api, added duration/current in seconds + shuffle & repeat
This commit is contained in:
12
src/features/api/helpers/handleWindowEvent.ts
Normal file
12
src/features/api/helpers/handleWindowEvent.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { BrowserWindow } from "electron";
|
||||
import { Response } from "express";
|
||||
|
||||
/**
|
||||
* Shorthand to handle a fire and forget global event
|
||||
* @param {*} res
|
||||
* @param {*} action
|
||||
*/
|
||||
export const handleWindowEvent = (mainWindow: BrowserWindow) => (res: Response, action: string) => {
|
||||
mainWindow.webContents.send("globalEvent", action);
|
||||
res.sendStatus(200);
|
||||
};
|
Reference in New Issue
Block a user