feat(core): move enable ai to feature flag (#8195)

This commit is contained in:
EYHN
2024-09-11 07:42:07 +00:00
parent 8c191e6baa
commit 498a69af53
15 changed files with 109 additions and 78 deletions
@@ -29,12 +29,17 @@ export class Flags extends Entity {
const configurable = flag.configurable ?? true;
const defaultState =
'defaultState' in flag ? flag.defaultState : undefined;
const getValue = () => {
return configurable
? (this.globalState.get<boolean>(FLAG_PREFIX + flagKey) ??
defaultState)
: defaultState;
};
const item = {
...flag,
value: configurable
? (this.globalState.get<boolean>(FLAG_PREFIX + flagKey) ??
defaultState)
: defaultState,
get value() {
return getValue();
},
set: (value: boolean) => {
if (!configurable) {
return;