Skip to content

Commit

Permalink
fix issue on meteor 3.0 on patch publish and perserve env variable (#191
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nachocodoner authored Sep 13, 2024
1 parent 7eeac22 commit 39c9ad0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions source/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, () => {

Check failure on line 223 in source/server.ts

View workflow job for this annotation

GitHub Actions / CI

Property 'connection' does not exist on type 'typeof Meteor'. Did you mean 'onConnection'?
return publish.call(
this,
name,
function (...args) {
return func.apply(this, args);
},
...args,
);
});
} as typeof Meteor.publish;
}

Expand Down

0 comments on commit 39c9ad0

Please sign in to comment.