소스 검색

refac: disable duplicate attachments

Timothy Jaeryang Baek 3 달 전
부모
커밋
b641756020
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/lib/components/chat/MessageInput/Commands.svelte

+ 4 - 0
src/lib/components/chat/MessageInput/Commands.svelte

@@ -78,6 +78,10 @@
 				}}
 				on:select={(e) => {
 					console.log(e);
+					if (files.find((f) => f.id === e.detail.id)) {
+						return;
+					}
+
 					files = [
 						...files,
 						{