Make store terser
This commit is contained in:
parent
9f712eda71
commit
ab3bf05dfe
|
@ -2,12 +2,7 @@ import { derived, Readable } from "svelte/store"
|
||||||
import { auth } from "@/stores/portal"
|
import { auth } from "@/stores/portal"
|
||||||
import { FeatureFlags, FeatureFlagDefaults } from "@budibase/types"
|
import { FeatureFlags, FeatureFlagDefaults } from "@budibase/types"
|
||||||
|
|
||||||
export const featureFlags: Readable<FeatureFlags> = derived(
|
export const featureFlags: Readable<FeatureFlags> = derived(auth, $auth => ({
|
||||||
[auth],
|
|
||||||
([$auth]) => {
|
|
||||||
return {
|
|
||||||
...FeatureFlagDefaults,
|
...FeatureFlagDefaults,
|
||||||
...($auth?.user?.flags || {}),
|
...($auth?.user?.flags || {}),
|
||||||
}
|
}))
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in New Issue