From 77cf2d8205f89de7f0c1e14a6b4d2054ead71c46 Mon Sep 17 00:00:00 2001 From: Michael Truell Date: Thu, 30 Mar 2023 00:04:29 -0700 Subject: [PATCH] Cleanup OAI / Login --- src/components/errors.tsx | 2 +- src/components/settingsPane.tsx | 112 ++++++++++++++++++-------------- src/index.css | 1 + src/main/main.ts | 1 + 4 files changed, 68 insertions(+), 48 deletions(-) diff --git a/src/components/errors.tsx b/src/components/errors.tsx index 823660d..b95e6f1 100644 --- a/src/components/errors.tsx +++ b/src/components/errors.tsx @@ -51,6 +51,7 @@ const loginStyles = { marginLeft: 'auto', marginRight: 'auto', maxWidth: '450px', + overflow: 'none', }, } @@ -177,7 +178,6 @@ export function ErrorPopup() { Upgrade -
Upgrade
diff --git a/src/components/settingsPane.tsx b/src/components/settingsPane.tsx index 846895a..677b83a 100644 --- a/src/components/settingsPane.tsx +++ b/src/components/settingsPane.tsx @@ -162,6 +162,7 @@ export function SettingsPopup() { />
+ {/* REMOVED CODEBASE-WIDE FEATURES! @@ -172,7 +173,6 @@ export function SettingsPopup() { languageName={name} /> ))} -
@@ -209,7 +209,6 @@ export function OpenAILoginPanel({ onSubmit }: { onSubmit: () => void }) { const handleNewAPIKey = useCallback(async () => { const { models, isValidKey } = await ssel.getModels(localAPIKey) - console.log({ models, isValidKey }) if (!isValidKey) { // Error, and we let them know showKeyError(true) @@ -219,11 +218,12 @@ export function OpenAILoginPanel({ onSubmit }: { onSubmit: () => void }) { dispatch( changeSettings({ openAIKey: localAPIKey, - }) - ) + useOpenAIKey: true, + openAIModel: models.at(0) ?? null + })) onSubmit() } - }, [localAPIKey]) + }, [dispatch, localAPIKey]) return (
@@ -267,17 +267,17 @@ export function OpenAILoginPanel({ onSubmit }: { onSubmit: () => void }) { ? 'bg-green-500' : 'bg-red-500' } - mt-2 relative inline-flex h-[38px] w-[74px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`} + mt-2 relative inline-flex h-[25px] w-[52px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`} > Use setting