diff --git a/package.json b/package.json
index 05a301f..ad870ca 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"description": "Pile",
- "version": "0.9.8",
+ "version": "0.9.9",
"keywords": [
"pile"
],
diff --git a/src/renderer/pages/Pile/Settings/AISettingsTabs/index.jsx b/src/renderer/pages/Pile/Settings/AISettingsTabs/index.jsx
index 202800f..0933365 100644
--- a/src/renderer/pages/Pile/Settings/AISettingsTabs/index.jsx
+++ b/src/renderer/pages/Pile/Settings/AISettingsTabs/index.jsx
@@ -9,7 +9,7 @@ import {
import { CardIcon, OllamaIcon, BoxOpenIcon } from 'renderer/icons';
import { useIndexContext } from 'renderer/context/IndexContext';
-export default function AISettingTabs() {
+export default function AISettingTabs({ APIkey, setCurrentKey }) {
const {
prompt,
setPrompt,
@@ -29,20 +29,6 @@ export default function AISettingTabs() {
} = useAIContext();
const { currentTheme, setTheme } = usePilesContext();
- const [key, setCurrentKey] = useState('');
-
- useEffect(() => {
- retrieveKey();
-
- if (ollama) {
- setPileAIProvider('ollama');
- }
- }, [ollama]);
-
- const retrieveKey = async () => {
- const k = await getKey();
- setCurrentKey(k);
- };
const handleTabChange = (newValue) => {
setPileAIProvider(newValue);
@@ -50,15 +36,6 @@ export default function AISettingTabs() {
const handleInputChange = (setter) => (e) => setter(e.target.value);
- const handleSaveChanges = () => {
- if (!key || key == '') {
- deleteKey();
- } else {
- setKey(key);
- }
- updateSettings(prompt);
- };
-
const renderThemes = () => {
return Object.entries(availableThemes).map(([theme, colors]) => (
diff --git a/src/renderer/pages/Pile/Settings/Settings.module.scss b/src/renderer/pages/Pile/Settings/Settings.module.scss
index 63aa6f3..13f82d2 100644
--- a/src/renderer/pages/Pile/Settings/Settings.module.scss
+++ b/src/renderer/pages/Pile/Settings/Settings.module.scss
@@ -60,7 +60,7 @@ input {
transform: translate(-50%, -50%);
width: 90vw;
max-width: 500px;
- max-height: 85vh;
+ max-height: 95vh;
padding: 18px;
animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
overflow-y: overlay;
diff --git a/src/renderer/pages/Pile/Settings/index.jsx b/src/renderer/pages/Pile/Settings/index.jsx
index 7f8f8b7..fd1e12f 100644
--- a/src/renderer/pages/Pile/Settings/index.jsx
+++ b/src/renderer/pages/Pile/Settings/index.jsx
@@ -26,7 +26,7 @@ export default function Settings() {
ollama,
baseUrl,
} = useAIContext();
- const [key, setCurrentKey] = useState('');
+ const [APIkey, setCurrentKey] = useState('');
const { currentTheme, setTheme } = usePilesContext();
const retrieveKey = async () => {
@@ -56,14 +56,15 @@ export default function Settings() {
};
const handleSaveChanges = () => {
- if (!key || key == '') {
+ if (!APIkey || APIkey == '') {
deleteKey();
} else {
- setKey(key);
+ console.log('save key', APIkey);
+ setKey(APIkey);
}
updateSettings(prompt);
- regenerateEmbeddings();
+ // regenerateEmbeddings();
};
const renderThemes = () => {
@@ -109,7 +110,7 @@ export default function Settings() {
-