github-actions[bot] commited on
Commit
25bb60f
·
1 Parent(s): 53878a2

Auto-deploy from GitHub: c48f310061b98ad4c60ed9195cb1b6e099f77a0d

Browse files
Files changed (1) hide show
  1. index.html +24 -4
index.html CHANGED
@@ -704,13 +704,20 @@
704
  selectedFile = e.target.files[0];
705
  if (selectedFile) {
706
  showNotification(`Selected: ${selectedFile.name}`);
 
 
 
 
 
707
  }
708
  });
709
 
710
- // Upload button
711
- uploadBtn.addEventListener('click', async () => {
 
 
 
712
  if (!selectedFile) {
713
- showNotification('Please select a file first!', 'error');
714
  return;
715
  }
716
 
@@ -744,6 +751,19 @@
744
  loader.style.display = 'none';
745
  uploadBtn.disabled = false;
746
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
747
  });
748
 
749
  // Load files
@@ -763,7 +783,7 @@
763
  const captionPreview = file.caption ?
764
  (file.caption.length > 50 ? file.caption.substring(0, 50) + '...' : file.caption) :
765
  '—';
766
-
767
  // Format estimated wait time
768
  let estWait = '—';
769
  if (file.status === 'not_started' && file.estimated_start_seconds !== null) {
 
704
  selectedFile = e.target.files[0];
705
  if (selectedFile) {
706
  showNotification(`Selected: ${selectedFile.name}`);
707
+ // Auto-upload if triggered by upload button click
708
+ if (pendingUpload) {
709
+ pendingUpload = false;
710
+ uploadFile();
711
+ }
712
  }
713
  });
714
 
715
+ // Flag to track if upload was triggered without file selection
716
+ let pendingUpload = false;
717
+
718
+ // Upload file function
719
+ async function uploadFile() {
720
  if (!selectedFile) {
 
721
  return;
722
  }
723
 
 
751
  loader.style.display = 'none';
752
  uploadBtn.disabled = false;
753
  }
754
+ }
755
+
756
+ // Upload button - one-click flow
757
+ uploadBtn.addEventListener('click', async () => {
758
+ if (!selectedFile) {
759
+ // No file selected - trigger file picker and auto-upload after selection
760
+ pendingUpload = true;
761
+ fileInput.click();
762
+ return;
763
+ }
764
+
765
+ // File already selected - upload directly
766
+ uploadFile();
767
  });
768
 
769
  // Load files
 
783
  const captionPreview = file.caption ?
784
  (file.caption.length > 50 ? file.caption.substring(0, 50) + '...' : file.caption) :
785
  '—';
786
+
787
  // Format estimated wait time
788
  let estWait = '—';
789
  if (file.status === 'not_started' && file.estimated_start_seconds !== null) {