mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-06-27 17:09:53 -04:00
WebUI: Delete correct rows after re-sort
The previous logic assumed that trs was properly sorted, which is no longer the case. Follow up to #22827. PR #22884.
This commit is contained in:
parent
254f39f89d
commit
67ef356064
1 changed files with 3 additions and 4 deletions
|
@ -886,6 +886,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
for (let rowPos = 0; rowPos < rows.length; ++rowPos) {
|
||||
const { rowId } = rows[rowPos];
|
||||
const tr = trMap.get(rowId);
|
||||
trMap.delete(rowId);
|
||||
|
||||
const isInCorrectLocation = rowId === trs[rowPos]?.rowId;
|
||||
if (!isInCorrectLocation) {
|
||||
|
@ -904,10 +905,8 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
prevTr = tr;
|
||||
}
|
||||
|
||||
const rowPos = rows.length;
|
||||
|
||||
while ((rowPos < trs.length) && (trs.length > 0))
|
||||
trs.pop().remove();
|
||||
for (const tr of trMap.values())
|
||||
tr.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue