patx/gitman

hide add file selector after import has started on repo settings

Commit 2d264d2 · patx · 2026-05-08T04:26:05Z

Changeset
2d264d2ee2d75e5430569edd732aa1af581dffdf
Parents
5893d3c0802092029500fba9df796508d477ba88

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/templates/base.tpl b/templates/base.tpl
index 2533d51..4aa0445 100644
--- a/templates/base.tpl
+++ b/templates/base.tpl
@@ -452,6 +452,7 @@
 
           const status = form.querySelector("[data-import-bundle-status]");
           const button = form.querySelector("button[type='submit']");
+          const fileControl = input ? input.closest("label") || input : null;
           const csrf = form.querySelector('input[name="_csrf_token"]');
           const url = new URL(form.dataset.uploadUrl, window.location.origin);
           url.searchParams.set("filename", file.name || "repo.bundle");
@@ -474,6 +475,12 @@
             button.disabled = true;
             button.hidden = true;
           }
+          if (input) {
+            input.disabled = true;
+          }
+          if (fileControl) {
+            fileControl.hidden = true;
+          }
 
           try {
             const chunkSize = 4 * 1024 * 1024;
@@ -544,6 +551,12 @@
               button.hidden = false;
               button.textContent = button.dataset.originalLabel || "Import bundle";
             }
+            if (input) {
+              input.disabled = false;
+            }
+            if (fileControl) {
+              fileControl.hidden = false;
+            }
           }
         });
       });