left_sidebar_mention: Fix mention highlight always visible.

Reproducer:

Mark a message where current user is mention as unread and then
read the message before animation ends. This prevents the
`animationend` from being triggered.

Fixed by also listening for `animationcancel` which fixes the bug.
This commit is contained in:
Aman Agrawal
2025-08-13 23:43:12 +05:30
committed by Tim Abbott
parent ab75c4f7c9
commit d8985597e7

View File

@@ -216,7 +216,7 @@ export function do_new_unread_animation($target: JQuery): void {
// and any other effects. Doing so also gives us
// very smooth rendering, as no visual properties
// get tied to JavaScript's event loop.
$target.on("animationend", (): void => {
$target.on("animationend, animationcancel", (): void => {
$target.removeClass("new-unread");
// We remove the transition-managing highlight
// some time after the animation has run; how