fix: undefined is not an object on connection table
This commit is contained in:
@@ -97,12 +97,17 @@ export const ConnectionTable = (props: Props) => {
|
|||||||
|
|
||||||
const originalPublishEvent = api.publishEvent;
|
const originalPublishEvent = api.publishEvent;
|
||||||
|
|
||||||
const patchedPublishEvent = ((...rawArgs: unknown[]) => {
|
// Use Proxy to create a more resilient wrapper that always normalizes events
|
||||||
rawArgs[2] = ensureMuiEvent(rawArgs[2]);
|
const patchedPublishEvent = new Proxy(originalPublishEvent, {
|
||||||
|
apply(target, thisArg, rawArgs: unknown[]) {
|
||||||
|
rawArgs[2] = ensureMuiEvent(rawArgs[2]);
|
||||||
|
|
||||||
return (
|
return Reflect.apply(
|
||||||
originalPublishEvent as unknown as (...args: unknown[]) => void
|
target as (...args: unknown[]) => unknown,
|
||||||
).apply(api, rawArgs);
|
thisArg,
|
||||||
|
rawArgs,
|
||||||
|
);
|
||||||
|
},
|
||||||
}) as typeof originalPublishEvent;
|
}) as typeof originalPublishEvent;
|
||||||
|
|
||||||
api.publishEvent = patchedPublishEvent;
|
api.publishEvent = patchedPublishEvent;
|
||||||
|
|||||||
Reference in New Issue
Block a user