Ver Fonte

fix: textarea input new line issue

Timothy Jaeryang Baek há 5 meses atrás
pai
commit
9ff580b8ca
1 ficheiros alterados com 10 adições e 2 exclusões
  1. 10 2
      src/lib/components/chat/Chat.svelte

+ 10 - 2
src/lib/components/chat/Chat.svelte

@@ -2309,7 +2309,11 @@
 								on:submit={async (e) => {
 									if (e.detail) {
 										await tick();
-										submitPrompt(e.detail.replaceAll('\n\n', '\n'));
+										submitPrompt(
+											($settings?.richTextInput ?? true)
+												? e.detail.replaceAll('\n\n', '\n')
+												: e.detail
+										);
 									}
 								}}
 							/>
@@ -2346,7 +2350,11 @@
 								on:submit={async (e) => {
 									if (e.detail) {
 										await tick();
-										submitPrompt(e.detail.replaceAll('\n\n', '\n'));
+										submitPrompt(
+											($settings?.richTextInput ?? true)
+												? e.detail.replaceAll('\n\n', '\n')
+												: e.detail
+										);
 									}
 								}}
 							/>