Skip to content

Commit a2a6556

Browse files
committed
chore: fix double cleanup in publication
1 parent b5406a0 commit a2a6556

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

meteor/server/publications/lib/rundownsObserver.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ export class RundownsObserver implements Meteor.LiveQueryHandle {
3030
if (this.#disposed) return
3131
if (!this.#changed) return
3232
this.#cleanup?.()
33+
this.#cleanup = undefined
3334

3435
const changed = this.#changed
3536
this.#cleanup = await changed(this.rundownIds)
3637

37-
if (this.#disposed) this.#cleanup?.()
38+
if (this.#disposed) {
39+
this.#cleanup?.()
40+
this.#cleanup = undefined
41+
}
3842
}, REACTIVITY_DEBOUNCE)
3943

4044
private constructor(onChanged: ChangedHandler) {
@@ -109,5 +113,6 @@ export class RundownsObserver implements Meteor.LiveQueryHandle {
109113
this.#rundownsLiveQuery.stop()
110114
this.#changed = undefined
111115
this.#cleanup?.()
116+
this.#cleanup = undefined
112117
}
113118
}

0 commit comments

Comments
 (0)