MCPcopy Create free account
hub / github.com/SKVNDR/FastDork / updateDorkCounter

Function updateDorkCounter

Script/FastDork.js:1577–1623  ·  view source on GitHub ↗
(listStorageKeyValue)

Source from the content-addressed store, hash-verified

1575 }
1576 }
1577 async function updateDorkCounter(listStorageKeyValue) {
1578 if (!UI.nbrCounter || !UI.goButton || !UI.limitButton) {
1579 console.error("Counter or Go/Limit button UI elements missing.");
1580 return;
1581 }
1582 let count = 0;
1583 let inputsValid = areTab1InputsValid(false);
1584 if (listStorageKeyValue && listStorageKeyValue !== "0") {
1585 try {
1586 const data = await getStorageData(listStorageKeyValue);
1587 if (data && Array.isArray(data[listStorageKeyValue])) {
1588 count = data[listStorageKeyValue].filter(Boolean).length;
1589 } else {
1590 count = 0;
1591 }
1592 } catch (error) {
1593 console.error(
1594 `Error getting list count for ${listStorageKeyValue}:`,
1595 error
1596 );
1597 count = 0;
1598 }
1599 } else {
1600 count = 0;
1601 }
1602 UI.nbrCounter.textContent = count;
1603 const limitExceeded = count > CONSTANTS.TAB_LIMIT;
1604 const isReady = inputsValid && count > 0 && !limitExceeded;
1605 updateRunStatus({ count, inputsValid, limitExceeded });
1606 if (limitExceeded) {
1607 UI.goButton.style.display = "none";
1608 UI.limitButton.style.display = "inline-block";
1609 UI.limitButton.textContent = `TOO MANY TABS (${count}/${CONSTANTS.TAB_LIMIT} max)`;
1610 UI.goButton.classList.remove("go-button-ready");
1611 UI.goButton.classList.add("go-button-inactive");
1612 } else {
1613 UI.goButton.style.display = "inline-flex";
1614 UI.limitButton.style.display = "none";
1615 if (isReady) {
1616 UI.goButton.classList.add("go-button-ready");
1617 UI.goButton.classList.remove("go-button-inactive");
1618 } else {
1619 UI.goButton.classList.remove("go-button-ready");
1620 UI.goButton.classList.add("go-button-inactive");
1621 }
1622 }
1623 }
1624 async function saveCurrentOptions() {
1625 if (
1626 !UI.targetTab1 ||

Callers 4

setupTabStructureFunction · 0.85
saveDorkListContentFunction · 0.85
initializeFunction · 0.85
setupEventListenersFunction · 0.85

Calls 3

areTab1InputsValidFunction · 0.85
updateRunStatusFunction · 0.85
getStorageDataFunction · 0.70

Tested by

no test coverage detected