From 550de4db06949aabf6fb8789efefce767075c161 Mon Sep 17 00:00:00 2001 From: "NGOCDG280\\ngocdg" <pnd280@gmail.com> Date: Tue, 19 Nov 2024 22:10:54 +0700 Subject: [PATCH] feat: force disable thread message toolbar --- package.json | 2 +- .../components/QueryBox/LanguageModelSelector.tsx | 7 ++----- src/content-script/components/QueryBox/index.tsx | 11 +---------- src/cplx-user-settings/CplxUserSettings.ts | 4 ++++ 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 9a992397..ef8cd45e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "complexity", "displayName": "Complexity - Perplexity AI Supercharged", - "version": "0.0.5.12", + "version": "0.0.5.13", "author": "pnd280", "description": "⚡ Supercharge your Perplexity AI", "type": "module", diff --git a/src/content-script/components/QueryBox/LanguageModelSelector.tsx b/src/content-script/components/QueryBox/LanguageModelSelector.tsx index 40cfd148..591b5f81 100644 --- a/src/content-script/components/QueryBox/LanguageModelSelector.tsx +++ b/src/content-script/components/QueryBox/LanguageModelSelector.tsx @@ -25,14 +25,11 @@ import UiUtils from "@/utils/UiUtils"; export default function LanguageModelSelector() { const limit = useQueryBoxStore((state) => state.queryLimit); - const opusLimit = useQueryBoxStore((state) => state.opusLimit); const o1Limit = useQueryBoxStore((state) => state.o1Limit); const getModelLimit = useCallback( (model: LanguageModel) => { switch (model.code) { - case "claude3opus": - return opusLimit; case "o1": return o1Limit; case "turbo": @@ -41,7 +38,7 @@ export default function LanguageModelSelector() { return limit; } }, - [limit, opusLimit, o1Limit], + [limit, o1Limit], ); const [modelsLimits, setModelsLimits] = useImmer< @@ -61,7 +58,7 @@ export default function LanguageModelSelector() { draft[model.code] = getModelLimit(model); }); }); - }, [limit, opusLimit, o1Limit, getModelLimit, setModelsLimits]); + }, [limit, o1Limit, getModelLimit, setModelsLimits]); return ( <Select diff --git a/src/content-script/components/QueryBox/index.tsx b/src/content-script/components/QueryBox/index.tsx index 08c29ecf..0ad3a663 100644 --- a/src/content-script/components/QueryBox/index.tsx +++ b/src/content-script/components/QueryBox/index.tsx @@ -7,12 +7,7 @@ import { LuPencil, } from "react-icons/lu"; import { PiGlobe } from "react-icons/pi"; -import { - SiAnthropic, - SiGooglegemini, - SiPerplexity, - SiYoutube, -} from "react-icons/si"; +import { SiAnthropic, SiPerplexity, SiYoutube } from "react-icons/si"; import { imageModels, @@ -20,7 +15,6 @@ import { focusModes, } from "@/content-script/components/QueryBox/consts"; import BlackForestLabs from "@/shared/components/icons/BlackForestLabsIcon"; -import MistralAiIcon from "@/shared/components/icons/MistralAiIcon"; import PlaygroundAiIcon from "@/shared/components/icons/PlaygroundAiIcon"; import StabilityAiIcon from "@/shared/components/icons/StabilityAiIcon"; import XAiIcon from "@/shared/components/icons/xAi"; @@ -36,7 +30,6 @@ type GroupedLanguageModelsByProvider = [ export const languageModelIcons: Record<LanguageModel["code"], ReactNode> = { claude2: <SiAnthropic />, claude35haiku: <SiAnthropic />, - claude3opus: <SiAnthropic />, o1: <AiOutlineOpenAI />, gpt4o: <AiOutlineOpenAI />, gpt4: <AiOutlineOpenAI />, @@ -44,8 +37,6 @@ export const languageModelIcons: Record<LanguageModel["code"], ReactNode> = { llama_x_large: <SiPerplexity />, experimental: <SiPerplexity />, turbo: <SiPerplexity />, - mistral: <MistralAiIcon />, - gemini: <SiGooglegemini />, }; export const groupedLanguageModelsByProvider: GroupedLanguageModelsByProvider = diff --git a/src/cplx-user-settings/CplxUserSettings.ts b/src/cplx-user-settings/CplxUserSettings.ts index 4117cead..eede5522 100644 --- a/src/cplx-user-settings/CplxUserSettings.ts +++ b/src/cplx-user-settings/CplxUserSettings.ts @@ -72,6 +72,10 @@ export default class CplxUserSettings { static async fetch() { CplxUserSettings.userSettings = await ChromeStorage.getStore(); + // TODO: remove this; + CplxUserSettings.userSettings.generalSettings.qolTweaks.threadMessageStickyToolbar = + false; + return CplxUserSettings.userSettings; }