(feature: PlanFeature)
| 30 | * having already triggered `loadSubscription`. |
| 31 | */ |
| 32 | export const useSQLEditorFeature = (feature: PlanFeature): boolean => { |
| 33 | const loadSubscription = useAppStore((s) => s.loadSubscription); |
| 34 | useEffect(() => { |
| 35 | void loadSubscription(); |
| 36 | }, [loadSubscription]); |
| 37 | return useAppStore((s) => s.hasFeature(feature)); |
| 38 | }; |
| 39 | |
| 40 | // Mirrors the Pinia `formatQueryDataPolicy` helper: normalizes |
| 41 | // `maximumResultRows` so `-1`/`0` (= unlimited) becomes `Number.MAX_VALUE`, |
no test coverage detected