Timothy J. Baek 7 місяців тому
батько
коміт
d784d5c367
1 змінених файлів з 10 додано та 1 видалено
  1. 10 1
      src/lib/components/common/FileItem.svelte

+ 10 - 1
src/lib/components/common/FileItem.svelte

@@ -33,7 +33,16 @@
 		class="h-14 {className} flex items-center space-x-3 {colorClassName} rounded-xl border border-gray-100 dark:border-gray-800 text-left"
 		type="button"
 		on:click={async () => {
-			showModal = !showModal;
+			if (file.content) {
+				showModal = !showModal;
+			} else {
+				if (url) {
+					if (type === 'file') {
+						window.open(`${url}/content`, '_blank').focus();
+					}
+				}
+			}
+
 			dispatch('click');
 		}}
 	>