Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(nc-gui): unsubscribeActiveChannels onBeforeUnmount useExpandedFormStore

Ramesh Mane3222419d447d
diff --git a/packages/nc-gui/composables/useExpandedFormStore.ts b/packages/nc-gui/composables/useExpandedFormStore.ts
index 45f7b19401..9f6df8c583 100644
--- a/packages/nc-gui/composables/useExpandedFormStore.ts
+++ b/packages/nc-gui/composables/useExpandedFormStore.ts
@@ -873,6 +873,16 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState(
{ immediate: true },
)
+ const unsubscribeActiveChannels = (): void => {
+ ;[activeDataListener.value, activeCommentListener.value].filter(Boolean).forEach((channel) => {
+ $ncSocket.offMessage(channel!)
+ })
+ }
+
+ onBeforeUnmount(() => {
+ unsubscribeActiveChannels()
+ })
+
return {
...rowStore,
loadComments,