WebUI: Set status filter to 'All' if selected filter is no longer visible

Fixup for #21145

To reproduce:
1. Select status filter with 0 torrents
2. Enable 'Auto hide zero status filters' and save settings. Hidden filter is still selected:

PR #22487.
This commit is contained in:
skomerko 2025-04-05 11:13:14 +02:00 committed by GitHub
commit 6c36830e5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -481,6 +481,8 @@ window.addEventListener("DOMContentLoaded", () => {
updateFilter("checking", "QBT_TR(Checking (%1))QBT_TR[CONTEXT=StatusFilterWidget]");
updateFilter("moving", "QBT_TR(Moving (%1))QBT_TR[CONTEXT=StatusFilterWidget]");
updateFilter("errored", "QBT_TR(Errored (%1))QBT_TR[CONTEXT=StatusFilterWidget]");
if (useAutoHideZeroStatusFilters && document.getElementById(`${selectedStatus}_filter`).classList.contains("invisible"))
setStatusFilter("all");
};
const highlightSelectedStatus = () => {