From 21c125471b96176bbee0ea8cb8e3ef3b708eb7eb Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 30 Sep 2025 01:05:24 +0500 Subject: fix: uploaded file section doesn't appear after the first upload --- public/index.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'public/index.php') diff --git a/public/index.php b/public/index.php index e64dd65..735f49d 100644 --- a/public/index.php +++ b/public/index.php @@ -555,6 +555,8 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt'); showFile(null); fileUploadWrapper.style.display = 'block'; fileURL.value = ''; + + document.querySelector('#uploaded-files').parentElement.style.display = 'grid'; }); const fileURLWrapper = document.querySelector('#form-upload-wrapper>div'); @@ -609,7 +611,19 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt'); }); setFormDetailsVisiblity(false); - displayTab('file-tabs', 'uploaded-files'); + const uploadedFileCount = getUploadedFiles().length; + const favoriteFileCount = getFavoriteFiles().length; + if (uploadedFileCount > 0) { + document.querySelector('#uploaded-files').parentElement.style.display = 'grid'; + displayTab('file-tabs', 'uploaded-files'); + } + + if (favoriteFileCount > 0) { + document.querySelector('#favorite-files').parentElement.style.display = 'grid'; + if (uploadedFileCount == 0) { + displayTab('file-tabs', 'favorite-files'); + } + } -- cgit v1.2.3