Browse Source

refac: disable duplicate attachments

Timothy Jaeryang Baek 3 months ago
parent
commit
b641756020
1 changed files with 4 additions and 0 deletions
  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,
 						{