mirror of
https://github.com/HugoAura/Seewo-HugoAura.git
synced 2026-06-25 18:54:29 +08:00
[Feat] Early support for PLS & Use JSDoc (Partially)
This commit is contained in:
32
src/aura/ui/pls/routes/config.js
Executable file
32
src/aura/ui/pls/routes/config.js
Executable file
@@ -0,0 +1,32 @@
|
||||
// @ts-check
|
||||
|
||||
const IPC_METHOD_BASE = "$aura.pls";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {PLSPush} parsedWsMsg
|
||||
* @returns
|
||||
*/
|
||||
const configRouteHandler = (parsedWsMsg) => {
|
||||
const target = parsedWsMsg.type.split(".").slice(-1)[0];
|
||||
switch (target) {
|
||||
case "pushBasicConfig":
|
||||
global.ipcRenderer.invoke(
|
||||
`${IPC_METHOD_BASE}.updatePlsSettings`,
|
||||
parsedWsMsg.data
|
||||
);
|
||||
break;
|
||||
case "pushRuleSettings":
|
||||
global.ipcRenderer.invoke(
|
||||
`${IPC_METHOD_BASE}.updatePlsRules`,
|
||||
parsedWsMsg.data
|
||||
);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
module.exports = { configRouteHandler };
|
||||
Reference in New Issue
Block a user