فهرست منبع

Fix "Cannot read properties of undefined (reading 'startsWith')"

Alex Gleason 2 ماه پیش
والد
کامیت
5639ba423b
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/lib/components/chat/Messages/Markdown/Source.svelte

+ 2 - 2
src/lib/components/chat/Messages/Markdown/Source.svelte

@@ -2,7 +2,7 @@
 	export let token;
 	export let onClick: Function = () => {};
 
-	let attributes: Record<string, string> = {};
+	let attributes: Record<string, string | undefined> = {};
 
 	function extractAttributes(input: string): Record<string, string> {
 		const regex = /(\w+)="([^"]*)"/g;
@@ -42,6 +42,6 @@
 	}}
 >
 	<span class="line-clamp-1">
-		{formattedTitle(attributes.title)}
+		{attributes.title ? formattedTitle(attributes.title) : ''}
 	</span>
 </button>