Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
fix: 移除ipc中的event
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-para committed Sep 5, 2023
1 parent 6535e00 commit 4f7fd25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/renderer/src/hooks/events/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

export default function useUiHooks(): void {
window.renderer.WindowManager = {
showMessage({ message, options }, event) {
showMessage({ message, options }) {
// ? 是否需要用string包裹防止xss
// event.returnValue = window.$message.create(String(message), options)
},
Expand Down
6 changes: 3 additions & 3 deletions packages/types/ipc/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type CallerWrapper<Func extends (...args: any[]) => any> = (
) => CleanVoid<Promise<UnPromise<ReturnType<Func>>>>

type CalleeWrapper<Func extends (...args: any[]) => any, Event> = (
...args: [...args: Parameters<Func>, event: Event]
...args: [...args: Parameters<Func>]
) => ReturnType<Func>

export type CallerProxyObjectType<
Expand Down Expand Up @@ -122,7 +122,7 @@ export function createCalleeProxy<
set(_target2: Record<string, unknown>, subk: string, func: (...args: any[]) => any) {
const mapper = _target.$$mapper as Map<Function, Function>
const wfunc = (event: ExtEvent, ...args: any[]) => {
return func(...args, event)
return func(...args)
}
mapper.set(func, wfunc)
add(`${scope}.${key}:${subk}`, wfunc)
Expand All @@ -146,7 +146,7 @@ export function createCalleeProxy<
const mapper = _target.$$mapper as Map<Function, Function>
const func = value[subk]
const wfunc = (event: ExtEvent, ...args: any[]) => {
return func(...args, event)
return func(...args)
}
mapper.set(func, wfunc)
add(`${scope}.${key}:${subk}`, wfunc)
Expand Down

0 comments on commit 4f7fd25

Please sign in to comment.