Explorar o código

refac: disable duplicate attachments

Timothy Jaeryang Baek hai 3 meses
pai
achega
b641756020
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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,
 						{