diff --git a/.env.example b/.env.example index fbc271c..dab6200 100644 --- a/.env.example +++ b/.env.example @@ -5,4 +5,5 @@ FIREBASE_PROJECTID= FIREBASE_STORAGEBUCKET= FIREBASE_MESSAGINGSENDERID= FIREBASE_APPID= -PUBLIC_DISABLE_TRACKING=true \ No newline at end of file +PUBLIC_DISABLE_TRACKING=true +SITE_SECRET=changeme \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7a17930..bb37c15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,19 @@ { "name": "@shipbit/slickgpt", - "version": "1.2.5", + "version": "1.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@shipbit/slickgpt", - "version": "1.2.5", + "version": "1.4.0", "license": "MIT", "dependencies": { "@floating-ui/dom": "^1.5.3", "@inqling/svelte-icons": "^4.0.2", "@vercel/analytics": "^1.1.0", "common-tags": "^1.8.2", + "cryptr": "^6.3.0", "firebase": "^10.4.0", "gpt3-tokenizer": "^1.1.5", "highlight.js": "^11.9.0", @@ -1832,6 +1833,11 @@ "node": "*" } }, + "node_modules/cryptr": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/cryptr/-/cryptr-6.3.0.tgz", + "integrity": "sha512-TA4byAuorT8qooU9H8YJhBwnqD151i1rcauHfJ3Divg6HmukHB2AYMp0hmjv2873J2alr4t15QqC7zAnWFrtfQ==" + }, "node_modules/css-tree": { "version": "2.3.1", "license": "MIT", diff --git a/package.json b/package.json index 2007872..44f2a4e 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "@inqling/svelte-icons": "^4.0.2", "@vercel/analytics": "^1.1.0", "common-tags": "^1.8.2", + "cryptr": "^6.3.0", "firebase": "^10.4.0", "gpt3-tokenizer": "^1.1.5", "highlight.js": "^11.9.0", diff --git a/src/lib/ChatInput.svelte b/src/lib/ChatInput.svelte index af22e96..1843ba5 100644 --- a/src/lib/ChatInput.svelte +++ b/src/lib/ChatInput.svelte @@ -17,7 +17,8 @@ isLoadingAnswerStore, liveAnswerStore, enhancedLiveAnswerStore, - settingsStore + settingsStore, + OpenAI_API_Key } from '$misc/stores'; import { countTokens } from '$misc/openai'; @@ -93,7 +94,7 @@ }) as ChatCompletionMessageParam ), settings: chat.settings, - openAiKey: $settingsStore.openAiApiKey + openAiKey: $OpenAI_API_Key }; $eventSourceStore.start(payload, handleAnswer, handleError, handleAbort); @@ -208,7 +209,7 @@ export async function editMessage(message: ChatMessage) { originalMessage = message; - input = message.content; + input = message.content + ''; isEditMode = true; // tick is required for the action to resize the textarea diff --git a/src/lib/Modals/SettingsModal.svelte b/src/lib/Modals/SettingsModal.svelte index 5ac3e83..137ad95 100644 --- a/src/lib/Modals/SettingsModal.svelte +++ b/src/lib/Modals/SettingsModal.svelte @@ -1,6 +1,6 @@