From 43bc47c1d9926de189869aed6cf111d13b4a9f7a Mon Sep 17 00:00:00 2001 From: wangyantong <51265903115@stu.ecnu.edu.cn> Date: Sat, 9 Nov 2024 20:00:12 +0800 Subject: [PATCH] feat: disable ossGpt by default (#907) --- src/options-storage.ts | 7 ++++++- src/pages/Options/Options.tsx | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/options-storage.ts b/src/options-storage.ts index 0b38fade..c507c7a5 100644 --- a/src/options-storage.ts +++ b/src/options-storage.ts @@ -6,7 +6,12 @@ export const defaults = Object.assign( { locale: 'en', }, - Object.fromEntries(importedFeatures.map((name) => [`hypercrx-${name}` as FeatureId, true])) + Object.fromEntries( + importedFeatures.map((name) => [ + `hypercrx-${name}` as FeatureId, + name === 'oss-gpt' ? false : true, // Set oss gpt to not be enabled by default + ]) + ) ); class OptionsStorage { diff --git a/src/pages/Options/Options.tsx b/src/pages/Options/Options.tsx index 6a50d4a6..75700677 100644 --- a/src/pages/Options/Options.tsx +++ b/src/pages/Options/Options.tsx @@ -28,7 +28,6 @@ const stacksStyleOptions = { const Options = (): JSX.Element => { const [version, setVersion] = useState(); const [options, setOptions] = useState(); - const { t, i18n } = useTranslation(); useEffect(() => { (async function () { @@ -36,7 +35,6 @@ const Options = (): JSX.Element => { setOptions(await optionsStorage.getAll()); })(); }, []); - if (!version || !options) { return
; }