From 781b98b1c103e9c91c8dd4520e318a0c6103af51 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Tue, 17 Mar 2026 23:21:56 +0100 Subject: [PATCH] Explicitly compare refCount with 0 --- packages/web_ui/src/store/default_mod_pack_store.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web_ui/src/store/default_mod_pack_store.ts b/packages/web_ui/src/store/default_mod_pack_store.ts index 4b92f30a..275066cb 100644 --- a/packages/web_ui/src/store/default_mod_pack_store.ts +++ b/packages/web_ui/src/store/default_mod_pack_store.ts @@ -27,7 +27,7 @@ class DefaultModPackStore { } subscribe(control: Control, callback: () => void) { - if (!this.refCount) { + if (this.refCount === 0) { const update = () => { this.fetchDefaultModPack(control); }; update(); this.interval = setInterval(update, 60e3); @@ -37,7 +37,7 @@ class DefaultModPackStore { return () => { this.callbacks.splice(this.callbacks.indexOf(callback), 1); this.refCount -= 1; - if (!this.refCount) { + if (this.refCount === 0) { clearInterval(this.interval); this.interval = undefined; }