Просмотр исходного кода

refac: disable duplicate attachments

Timothy Jaeryang Baek 3 месяцев назад
Родитель
Сommit
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,
 						{