Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix/ui-no-return-to-rundown-if-d…
Browse files Browse the repository at this point in the history
…eleted' into bbc-release52
  • Loading branch information
mint-dewit committed Oct 1, 2024
2 parents 274a0c7 + 7c4f1ae commit daf9700
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ export function useSubscription<K extends keyof AllPubSubTypes>(
/**
* A Meteor Subscription hook that allows using React Functional Components and the Hooks API with Meteor subscriptions.
* Subscriptions will be torn down 1000ms after unmounting the component.
* If the subscription is not enabled, the subscription will not be created, and the ready state will always be true.
*
* @export
* @param {PubSub} sub The subscription to be subscribed to
Expand Down Expand Up @@ -421,7 +422,7 @@ export function useSubscriptionIfEnabled<K extends keyof AllPubSubTypes>(
}
}, [sub, enable, stringifyObjects(args)])

return ready
return !enable || ready
}

/**
Expand Down

0 comments on commit daf9700

Please sign in to comment.