mirror of
https://github.com/chrononeko/chronocat.git
synced 2024-11-16 12:51:39 +00:00
fix(event): fix ipcman
This commit is contained in:
parent
e1896fa434
commit
fdcc612b3d
@ -135,8 +135,12 @@ export const apply = async (ctx: ChronocatContext) => {
|
|||||||
const handler = (data: IpcManData) => {
|
const handler = (data: IpcManData) => {
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case 'event': {
|
case 'event': {
|
||||||
const d = data.args[1] as RedIpcDataEvent
|
if (!data.args[1] || !Array.isArray(data.args[1])) return
|
||||||
void dispatcher(d.cmdName, d.payload)
|
const d = data.args[1] as [RedIpcDataEvent]
|
||||||
|
if (!d.length) return
|
||||||
|
const e = d[0]
|
||||||
|
if (!e || !('cmdName' in e)) return
|
||||||
|
void dispatcher(e.cmdName, e.payload)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user