From d784d5c367de970d2ae55d075afd15b65548ad39 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 29 Sep 2024 18:33:16 +0200 Subject: [PATCH] refac --- src/lib/components/common/FileItem.svelte | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/components/common/FileItem.svelte b/src/lib/components/common/FileItem.svelte index 46eac31b8..67cbdf509 100644 --- a/src/lib/components/common/FileItem.svelte +++ b/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'); }} >