This commit is contained in:
Timothy J. Baek 2024-08-23 14:43:32 +02:00
parent 591962d906
commit 7b91be21b4
3 changed files with 9 additions and 6 deletions

View File

@ -280,7 +280,7 @@
<div class="w-full relative">
{#if atSelectedModel !== undefined}
<div
class="px-3 py-2.5 text-left w-full flex justify-between items-center absolute bottom-0 left-0 right-0 bg-gradient-to-t from-50% from-white dark:from-gray-900 z-10"
class="px-3 py-2.5 text-left w-full flex justify-between items-center absolute bottom-0.5 left-0 right-0 bg-gradient-to-t from-50% from-white dark:from-gray-900 z-10"
>
<div class="flex items-center gap-2 text-sm dark:text-gray-500">
<img

View File

@ -2,7 +2,7 @@
import { createEventDispatcher } from 'svelte';
import { documents } from '$lib/stores';
import { removeFirstHashWord, isValidHttpUrl } from '$lib/utils';
import { removeLastWordFromString, isValidHttpUrl } from '$lib/utils';
import { tick, getContext } from 'svelte';
import { toast } from 'svelte-sonner';
@ -79,7 +79,7 @@
const confirmSelect = async (doc) => {
dispatch('select', doc);
prompt = removeFirstHashWord(prompt);
prompt = removeLastWordFromString(prompt, command);
const chatInputElement = document.getElementById('chat-textarea');
await tick();
@ -90,7 +90,7 @@
const confirmSelectWeb = async (url) => {
dispatch('url', url);
prompt = removeFirstHashWord(prompt);
prompt = removeLastWordFromString(prompt, command);
const chatInputElement = document.getElementById('chat-textarea');
await tick();
@ -101,7 +101,7 @@
const confirmSelectYoutube = async (url) => {
dispatch('youtube', url);
prompt = removeFirstHashWord(prompt);
prompt = removeLastWordFromString(prompt, command);
const chatInputElement = document.getElementById('chat-textarea');
await tick();

View File

@ -297,7 +297,10 @@ export const removeLastWordFromString = (inputString, wordString) => {
}
// Join the remaining words back into a string
const resultString = words.join(' ');
let resultString = words.join(' ');
if (resultString !== '') {
resultString += ' ';
}
return resultString;
};