killemov / Shift

A minimalistic approach to maximum control of your Transmission. (Web UI)
https://forum.transmissionbt.com/viewtopic.php?f=8&t=12555
260 stars 20 forks source link

Names not displayed for torrents that have labels #22

Closed Shados closed 2 years ago

Shados commented 2 years ago

This change in the most-recent commit broke the display of names for any torrents labels: https://github.com/killemov/Shift/blob/2e723908b568e409f4f32a066632b27438e5c98b/shift.js#L1600-L1608

Specifically, the return = ""; on line 1605 results in blanking out the name column for any torrents that have one or more labels set, due to updateElement() seeing that the "" returned from this doesn't match the cell.innerHTML, wherein it replaces the cell contents with "". Mixing imperative and functional behaviour in a single function has a tendency to lead to this kind of problem.

Without re-structuring the code, the simplest fix is to just replace line 1605 with return cell.innerHTML;, but this is a bit cursed.