Timothy J. Baek 9 months ago
parent
commit
5904ef86f2
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/lib/components/chat/Messages/MarkdownTokens.svelte

+ 4 - 0
src/lib/components/chat/Messages/MarkdownTokens.svelte

@@ -39,6 +39,10 @@
 			const codeElement = document.getElementById(`code-${codeId}`);
 			if (codeElement) {
 				clearInterval(interval);
+				// If the code is already loaded, don't load it again
+				if (codeElement.innerHTML) {
+					return;
+				}
 
 				new CodeBlock({
 					target: codeElement,