Ver Fonte

fix: codeblock

Timothy Jaeryang Baek há 2 meses atrás
pai
commit
802f8809dd

+ 2 - 2
src/lib/components/chat/Messages/CodeBlock.svelte

@@ -464,8 +464,8 @@
 					onSave={() => {
 						saveCode();
 					}}
-					onChange={(e) => {
-						_code = e;
+					onChange={(value) => {
+						_code = value;
 					}}
 				/>
 			</div>

+ 3 - 3
src/lib/components/chat/Messages/Markdown/MarkdownTokens.svelte

@@ -88,14 +88,14 @@
 				code={token?.text ?? ''}
 				{attributes}
 				{save}
-				onCode={(e) => {
-					dispatch('code', e);
+				onCode={(value) => {
+					dispatch('code', value);
 				}}
 				onSave={(e) => {
 					dispatch('update', {
 						raw: token.raw,
 						oldContent: token.text,
-						newContent: e
+						newContent: value
 					});
 				}}
 			/>

+ 2 - 2
src/lib/components/common/CodeEditor.svelte

@@ -79,7 +79,7 @@
 				});
 
 				_value = formattedCode;
-				onChange({ value: _value });
+				onChange(_value);
 				await tick();
 
 				toast.success($i18n.t('Code formatted successfully'));
@@ -98,7 +98,7 @@
 		EditorView.updateListener.of((e) => {
 			if (e.docChanged) {
 				_value = e.state.doc.toString();
-				onChange({ value: _value });
+				onChange(_value);
 			}
 		}),
 		editorTheme.of([]),