mirror of
https://github.com/open-webui/open-webui
synced 2025-04-02 12:09:06 +00:00
refac: prompt command behaviour
This commit is contained in:
parent
300b7dfcc0
commit
effa87638d
@ -855,7 +855,6 @@
|
||||
on:keydown={async (e) => {
|
||||
const isCtrlPressed = e.ctrlKey || e.metaKey; // metaKey is for Cmd key on Mac
|
||||
|
||||
console.log('keydown', e);
|
||||
const commandsContainerElement =
|
||||
document.getElementById('commands-container');
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { prompts, user } from '$lib/stores';
|
||||
import { prompts, settings, user } from '$lib/stores';
|
||||
import {
|
||||
findWordIndices,
|
||||
getUserPosition,
|
||||
@ -120,12 +120,16 @@
|
||||
text = text.replaceAll('{{CURRENT_WEEKDAY}}', weekday);
|
||||
}
|
||||
|
||||
const promptWords = prompt.split(' ');
|
||||
const paragraphs = prompt.split('\n');
|
||||
|
||||
let lastParagraph = paragraphs.pop();
|
||||
const promptWords = lastParagraph.split(' ');
|
||||
|
||||
promptWords.pop();
|
||||
promptWords.push(`${text}`);
|
||||
|
||||
prompt = promptWords.join(' ');
|
||||
lastParagraph = promptWords.join(' ');
|
||||
prompt = $settings?.richTextInput ? paragraphs.join('<br/>') : paragraphs.join('\n');
|
||||
|
||||
const chatInputContainerElement = document.getElementById('chat-input-container');
|
||||
const chatInputElement = document.getElementById('chat-input');
|
||||
|
Loading…
Reference in New Issue
Block a user