feat: create named feature flag for settings v2 (#1976)
This commit is contained in:
@@ -5,6 +5,7 @@ import { Sliders } from 'lucide-react';
|
||||
import { ModelRadioList } from './settings/models/ModelRadioList';
|
||||
import { Document, ChevronUp, ChevronDown } from './icons';
|
||||
import type { View } from '../App';
|
||||
import { settingsV2Enabled } from '../flags';
|
||||
import { BottomMenuModeSelection } from './BottomMenuModeSelection';
|
||||
import ModelsBottomBar from './settings_v2/models/bottom_bar/ModelsBottomBar';
|
||||
|
||||
@@ -78,7 +79,7 @@ export default function BottomMenu({
|
||||
<BottomMenuModeSelection />
|
||||
|
||||
{/* Model Selector Dropdown */}
|
||||
{process.env.ALPHA ? (
|
||||
{settingsV2Enabled ? (
|
||||
<ModelsBottomBar dropdownRef={dropdownRef} setView={setView} />
|
||||
) : (
|
||||
<div className="relative flex items-center ml-auto mr-4" ref={dropdownRef}>
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
ModeSelectionItem,
|
||||
} from './settings/basic/ModeSelectionItem';
|
||||
import { useConfig } from './ConfigContext';
|
||||
import { settingsV2Enabled } from '../flags';
|
||||
|
||||
export const BottomMenuModeSelection = () => {
|
||||
const [isGooseModeMenuOpen, setIsGooseModeMenuOpen] = useState(false);
|
||||
@@ -18,7 +19,7 @@ export const BottomMenuModeSelection = () => {
|
||||
useEffect(() => {
|
||||
const fetchCurrentMode = async () => {
|
||||
try {
|
||||
if (!process.env.ALPHA) {
|
||||
if (!settingsV2Enabled) {
|
||||
const response = await fetch(getApiUrl('/configs/get?key=GOOSE_MODE'), {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
@@ -85,7 +86,7 @@ export const BottomMenuModeSelection = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!process.env.ALPHA) {
|
||||
if (!settingsV2Enabled) {
|
||||
const storeResponse = await fetch(getApiUrl('/configs/store'), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { ChatSmart, Idea, More, Refresh, Time, Send } from '../icons';
|
||||
import { FolderOpen, Moon, Sliders, Sun } from 'lucide-react';
|
||||
import { View } from '../../App';
|
||||
import { useConfig } from '../ConfigContext';
|
||||
import { toastService } from '../../toasts';
|
||||
import { settingsV2Enabled } from '../../flags';
|
||||
|
||||
interface VersionInfo {
|
||||
current_version: string;
|
||||
@@ -257,7 +257,7 @@ export default function MoreMenu({
|
||||
<span className="text-textSubtle ml-1">⌘,</span>
|
||||
</MenuButton>
|
||||
|
||||
{process.env.ALPHA && (
|
||||
{settingsV2Enabled && (
|
||||
<MenuButton
|
||||
onClick={async () => {
|
||||
await remove('GOOSE_PROVIDER', false);
|
||||
@@ -274,7 +274,7 @@ export default function MoreMenu({
|
||||
</MenuButton>
|
||||
)}
|
||||
|
||||
{!process.env.ALPHA && (
|
||||
{!settingsV2Enabled && (
|
||||
<MenuButton
|
||||
onClick={() => {
|
||||
localStorage.removeItem('GOOSE_PROVIDER');
|
||||
|
||||
Reference in New Issue
Block a user