mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-28 06:22:33 +00:00
fix: picking a prompt from / in a channel inserts the prompt text (#32713)
This commit is contained in:
parent
46cdd70d7b
commit
1d0b782719
1 changed files with 18 additions and 0 deletions
|
|
@ -711,6 +711,24 @@
|
|||
: []),
|
||||
{
|
||||
char: '/',
|
||||
command: ({ editor, range, props }) => {
|
||||
if (props?.type === 'prompt') {
|
||||
void insertTextAtCursor(props.content ?? '');
|
||||
return;
|
||||
}
|
||||
|
||||
editor
|
||||
.chain()
|
||||
.focus()
|
||||
.insertContentAt(range, [
|
||||
{
|
||||
type: 'mention',
|
||||
attrs: { ...props, mentionSuggestionChar: '/' }
|
||||
},
|
||||
{ type: 'text', text: ' ' }
|
||||
])
|
||||
.run();
|
||||
},
|
||||
render: getSuggestionRenderer(CommandSuggestionList, {
|
||||
i18n,
|
||||
onSelect: (e) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue