aktueller stand

This commit is contained in:
2026-01-07 22:50:35 +01:00
parent b81c2042e9
commit 9675e73406
6 changed files with 146 additions and 14 deletions

View File

@@ -2031,18 +2031,17 @@ function cancelPendingAutoOpen(showMessage = false) {
}
}
function getPendingVisibleCandidates() {
function getPendingCandidates({ includeHidden = false } = {}) {
if (currentTab !== 'pending') {
return { items: [], totalVisible: 0, cooldownBlocked: 0 };
return { items: [], totalConsidered: 0, cooldownBlocked: 0 };
}
const { filteredItems } = getPostListState();
const visibleCount = Math.min(filteredItems.length, getVisibleCount(currentTab));
const visibleItems = filteredItems
.slice(0, visibleCount)
const consideredItems = (includeHidden ? filteredItems : filteredItems.slice(0, visibleCount))
.filter(({ post }) => post && post.url);
const items = visibleItems.filter(({ post }) => !isPendingOpenCooldownActive(post.id));
const cooldownBlocked = Math.max(0, visibleItems.length - items.length);
return { items, totalVisible: visibleItems.length, cooldownBlocked };
const items = consideredItems.filter(({ post }) => !isPendingOpenCooldownActive(post.id));
const cooldownBlocked = Math.max(0, consideredItems.length - items.length);
return { items, totalConsidered: consideredItems.length, cooldownBlocked };
}
function openPendingBatch({ auto = false } = {}) {
@@ -2052,13 +2051,14 @@ function openPendingBatch({ auto = false } = {}) {
if (!auto) {
cancelPendingAutoOpen(false);
}
const { items: candidates, totalVisible, cooldownBlocked } = getPendingVisibleCandidates();
const includeHidden = true;
const { items: candidates, totalConsidered, cooldownBlocked } = getPendingCandidates({ includeHidden });
if (!candidates.length) {
if (!auto) {
if (totalVisible === 0) {
if (totalConsidered === 0) {
setPendingBulkStatus('Keine offenen Beiträge zum Öffnen.', true);
} else if (cooldownBlocked > 0) {
setPendingBulkStatus('Alle sichtbaren Beiträge sind noch im Cooldown (40 min).', true);
setPendingBulkStatus('Alle Beiträge sind noch im Cooldown (40 min).', true);
} else {
setPendingBulkStatus('Keine offenen Beiträge zum Öffnen.', true);
}
@@ -2116,7 +2116,7 @@ function maybeAutoOpenPending(reason = '', delayMs = PENDING_AUTO_OPEN_DELAY_MS)
if (pendingAutoOpenTriggered) {
return;
}
const { items: candidates } = getPendingVisibleCandidates();
const { items: candidates } = getPendingCandidates({ includeHidden: true });
if (!candidates.length) {
hidePendingAutoOpenOverlay();
return;