WebUI: enforce coding style

* WebUI: prefer `classList.toggle()` over other pattern
  Addresses: https://github.com/qbittorrent/qBittorrent/pull/23231#discussion_r2328647152
* WebUI: prefer using built-in objects Constructor
* WebUI: combine function calls

PR #23261.
This commit is contained in:
Chocobo1
2025-09-14 22:11:23 +08:00
committed by GitHub
parent 5edaf2cf10
commit b0148ef36c
6 changed files with 14 additions and 22 deletions

View File

@@ -620,8 +620,8 @@
if (articlesDiffer) {
// update unread count
const oldUnread = feedData[r.uid].map((art) => !art.isRead).filter((v) => v).length;
const newUnread = r.articles.map((art) => !art.isRead).filter((v) => v).length;
const oldUnread = feedData[r.uid].map((art) => !art.isRead).filter(Boolean).length;
const newUnread = r.articles.map((art) => !art.isRead).filter(Boolean).length;
const unreadDifference = newUnread - oldUnread;
// find all parents (and self) and add unread difference
@@ -733,7 +733,7 @@
});
// calculate number of unread
const numberOfUnread = dataEntry.articles.map((art) => !art.isRead).filter((v) => v).length;
const numberOfUnread = dataEntry.articles.map((art) => !art.isRead).filter(Boolean).length;
// find all items that contain this rss feed and add unread count
for (const row of rssFeedTable.getRowValues()) {
if (dataEntry.fullName.slice(0, row.full_data.dataPath.length) === row.full_data.dataPath)