Claude: Avoid using the current message on sidebar closing

This commit is contained in:
Alessandro Pignotti 2024-12-19 16:38:24 +01:00
parent 29fe270168
commit b5443fa60f
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<script>
import { apiState, setApiKey, addMessage, messageList } from '$lib/anthropic.js'
import { apiState, setApiKey, addMessage, messageList, currentMessage } from '$lib/anthropic.js'
import PanelButton from './PanelButton.svelte';
export let handleTool;
function handleKeyEnter(e)
@ -73,5 +73,5 @@
{#if $apiState == "KEY_REQUIRED"}
<textarea class="bg-neutral-700 p-2 rounded-md placeholder-gray-400 resize-none shrink-0" placeholder="Insert your Claude API Key" rows="1" on:keydown={handleKeyEnter} on:input={handleResize}/>
{:else}
<textarea class="bg-neutral-700 p-2 rounded-md placeholder-gray-400 resize-none shrink-0" placeholder="Prompt..." rows="1" on:keydown={handleMessage} on:input={handleResize}/>
<textarea class="bg-neutral-700 p-2 rounded-md placeholder-gray-400 resize-none shrink-0" placeholder="Prompt..." rows="1" on:keydown={handleMessage} on:input={handleResize} bind:value={$currentMessage}/>
{/if}

View File

@ -94,6 +94,7 @@ function initialize()
export const apiState = writable("KEY_REQUIRED");
export const messageList = writable(messages);
export const currentMessage = writable("");
if(browser)
initialize();