Skip to content

Commit

Permalink
Update FeaturesTab.tsx
Browse files Browse the repository at this point in the history
Bug fix : Preserve Settings FeatureTab
  • Loading branch information
Stijnus committed Feb 14, 2025
1 parent a0ea69f commit 79ea72a
Showing 1 changed file with 16 additions and 6 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

0 comments on commit 79ea72a

Please sign in to comment.