fix(dashcam): use style.display instead of hidden attr (d-flex overrides hidden)
Bootstrap d-flex sets display:flex !important which beats the HTML hidden attribute. Switch to style.display='none'/'flex' for both status bars. Co-authored-by: Copilot <[email protected]>
This commit is contained in:
+5
-8
@@ -27,14 +27,12 @@ function showImportProgress(msg, total) {
|
||||
importStartTime = Date.now();
|
||||
importStatus.textContent = msg;
|
||||
importEta.textContent = '';
|
||||
importStatusBar.hidden = false;
|
||||
importResultBar.hidden = true;
|
||||
// Update ETA every second based on elapsed time vs total
|
||||
importStatusBar.style.display = 'flex';
|
||||
importResultBar.style.display = 'none';
|
||||
clearInterval(importEtaInterval);
|
||||
if (importTotal > 0) {
|
||||
importEtaInterval = setInterval(() => {
|
||||
const elapsed = (Date.now() - importStartTime) / 1000;
|
||||
// rough heuristic: ~3s per video on average
|
||||
const estTotal = importTotal * 3;
|
||||
const remaining = Math.max(0, Math.round(estTotal - elapsed));
|
||||
importEta.textContent = remaining > 0 ? `~${remaining}s remaining` : '';
|
||||
@@ -44,11 +42,10 @@ function showImportProgress(msg, total) {
|
||||
|
||||
function showImportResult(msg) {
|
||||
clearInterval(importEtaInterval);
|
||||
importStatusBar.hidden = true;
|
||||
importStatusBar.style.display = 'none';
|
||||
importResult.textContent = msg;
|
||||
importResultBar.hidden = false;
|
||||
// Auto-hide result after 10s
|
||||
setTimeout(() => { importResultBar.hidden = true; }, 10000);
|
||||
importResultBar.style.display = 'block';
|
||||
setTimeout(() => { importResultBar.style.display = 'none'; }, 10000);
|
||||
}
|
||||
|
||||
function fetchJson(url, options) {
|
||||
|
||||
Reference in New Issue
Block a user