From e67f8f95cd306424cb83ade0eb03440072cf50c0 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 15 Jan 2022 13:00:27 +0000 Subject: [PATCH] fix(messaging): prevent message overlay from sticking after finishing edit --- src/components/common/messaging/Message.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/common/messaging/Message.tsx b/src/components/common/messaging/Message.tsx index 801985e8..b3ead6b3 100644 --- a/src/components/common/messaging/Message.tsx +++ b/src/components/common/messaging/Message.tsx @@ -3,7 +3,7 @@ import { Message as MessageObject } from "revolt.js/dist/maps/Messages"; import { attachContextMenu } from "preact-context-menu"; import { memo } from "preact/compat"; -import { useState } from "preact/hooks"; +import { useEffect, useState } from "preact/hooks"; import { internalEmit } from "../../../lib/eventEmitter"; import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice"; @@ -89,6 +89,7 @@ const Message = observer( // ! FIXME(?): animate on hover const [mouseHovering, setAnimate] = useState(false); + useEffect(() => setAnimate(false), [replacement]); return (