Skip to content

Commit

Permalink
fix: bug fix New UI / Feature tab - Default values hard-coded
Browse files Browse the repository at this point in the history
It was not possible to change "Context Optimization" and "Prompt Library".
  • Loading branch information
leex279 authored Feb 15, 2025
2 parents a0ea69f + 823c66e commit 294adfd
Show file tree
Hide file tree
Showing 2 changed files with 8,262 additions and 6,853 deletions.
22 changes: 16 additions & 6 deletions app/components/@settings/tabs/features/FeaturesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,23 @@ export default function FeaturesTab() {

// Enable features by default on first load
React.useEffect(() => {
// Force enable these features by default
enableLatestBranch(true);
enableContextOptimization(true);
setAutoSelectTemplate(true);
setPromptId('optimized');
// Only set defaults if values are undefined
if (isLatestBranch === undefined) {
enableLatestBranch(true);
}

if (contextOptimizationEnabled === undefined) {
enableContextOptimization(true);
}

if (autoSelectTemplate === undefined) {
setAutoSelectTemplate(true);
}

if (promptId === undefined) {
setPromptId('optimized');
}

// Only enable event logs if not explicitly set before
if (eventLogs === undefined) {
setEventLogs(true);
}
Expand Down
Loading

0 comments on commit 294adfd

Please sign in to comment.