Skip to content

Commit 294adfd

Browse files
authored
fix: bug fix New UI / Feature tab - Default values hard-coded
It was not possible to change "Context Optimization" and "Prompt Library".
2 parents a0ea69f + 823c66e commit 294adfd

File tree

2 files changed

+8262
-6853
lines changed

2 files changed

+8262
-6853
lines changed

app/components/@settings/tabs/features/FeaturesTab.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,23 @@ export default function FeaturesTab() {
121121

122122
// Enable features by default on first load
123123
React.useEffect(() => {
124-
// Force enable these features by default
125-
enableLatestBranch(true);
126-
enableContextOptimization(true);
127-
setAutoSelectTemplate(true);
128-
setPromptId('optimized');
124+
// Only set defaults if values are undefined
125+
if (isLatestBranch === undefined) {
126+
enableLatestBranch(true);
127+
}
128+
129+
if (contextOptimizationEnabled === undefined) {
130+
enableContextOptimization(true);
131+
}
132+
133+
if (autoSelectTemplate === undefined) {
134+
setAutoSelectTemplate(true);
135+
}
136+
137+
if (promptId === undefined) {
138+
setPromptId('optimized');
139+
}
129140

130-
// Only enable event logs if not explicitly set before
131141
if (eventLogs === undefined) {
132142
setEventLogs(true);
133143
}

0 commit comments

Comments
 (0)