From 39c9ad0c05e4aaa3141f60eb52c375c486f63616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Fri, 13 Sep 2024 10:51:00 +0200 Subject: [PATCH] fix issue on meteor 3.0 on patch publish and perserve env variable (#191) --- source/server.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/server.ts b/source/server.ts index d55ea8c..52b491f 100644 --- a/source/server.ts +++ b/source/server.ts @@ -220,16 +220,16 @@ Meteor.onConnection(connection => { function patchPublish(publish: typeof Meteor.publish) { return function (this: typeof Meteor, name, func, ...args) { - return publish.call( - this, - name, - function (...args) { - return _publishConnectionId.withValue(this?.connection?.id, () => - func.apply(this, args), - ); - }, - ...args, - ); + return _publishConnectionId.withValue(this?.connection?.id, () => { + return publish.call( + this, + name, + function (...args) { + return func.apply(this, args); + }, + ...args, + ); + }); } as typeof Meteor.publish; }