oliver-zehentleitner / maity

web: chats / chat: one redraw-keeping-focus helper and one read-coalescing helper (three and four copies)

Sign in to report

tsk-xw928bzzhctg Proposed

Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. View: chats list, chat. Kind: duplication.

What is wrong

  • "Remember the focused href, keepImages, clear and append, refocus" is copied at chat.js:211-231, chats.js:69-95 (drawCross, new) and chats.js:96-128.
  • "One read at a time, run once more after it" is copied at chat.js:252-262, chats.js:186-195, chats.js:261-271 and placements.js:317.

Proposal

  • M.dom.redrawList(ul, fresh, selector) and a small coalescing helper in dom.js.

Effort / risk: S. Low.