Merge branch 'master' into chore/aws-v2-to-v3
This commit is contained in:
commit
b5003e156d
|
@ -4,14 +4,14 @@ import { admin } from "@/stores/portal"
|
|||
import analytics from "@/analytics"
|
||||
import { BudiStore } from "@/stores/BudiStore"
|
||||
import {
|
||||
GetGlobalSelfResponse,
|
||||
isSSOUser,
|
||||
SetInitInfoRequest,
|
||||
UpdateSelfRequest,
|
||||
User,
|
||||
} from "@budibase/types"
|
||||
|
||||
interface PortalAuthStore {
|
||||
user?: User
|
||||
user?: GetGlobalSelfResponse
|
||||
initInfo?: Record<string, any>
|
||||
accountPortalAccess: boolean
|
||||
loaded: boolean
|
||||
|
@ -33,7 +33,7 @@ class AuthStore extends BudiStore<PortalAuthStore> {
|
|||
})
|
||||
}
|
||||
|
||||
setUser(user?: User) {
|
||||
setUser(user?: GetGlobalSelfResponse) {
|
||||
this.set({
|
||||
loaded: true,
|
||||
user: user,
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
import { derived } from "svelte/store"
|
||||
import { auth } from "@/stores/portal"
|
||||
|
||||
export const INITIAL_FEATUREFLAG_STATE = {
|
||||
SQS: false,
|
||||
DEFAULT_VALUES: false,
|
||||
BUDIBASE_AI: false,
|
||||
AI_CUSTOM_CONFIGS: false,
|
||||
}
|
||||
|
||||
export const featureFlags = derived([auth], ([$auth]) => {
|
||||
return {
|
||||
...INITIAL_FEATUREFLAG_STATE,
|
||||
...($auth?.user?.flags || {}),
|
||||
}
|
||||
})
|
|
@ -0,0 +1,8 @@
|
|||
import { derived, Readable } from "svelte/store"
|
||||
import { auth } from "@/stores/portal"
|
||||
import { FeatureFlags, FeatureFlagDefaults } from "@budibase/types"
|
||||
|
||||
export const featureFlags: Readable<FeatureFlags> = derived(auth, $auth => ({
|
||||
...FeatureFlagDefaults,
|
||||
...($auth?.user?.flags || {}),
|
||||
}))
|
Loading…
Reference in New Issue