fix(messaging): prevent message overlay from sticking after finishing edit

This commit is contained in:
Paul Makles 2022-01-15 13:00:27 +00:00
parent bb5f940ad1
commit e67f8f95cd

View file

@ -3,7 +3,7 @@ import { Message as MessageObject } from "revolt.js/dist/maps/Messages";
import { attachContextMenu } from "preact-context-menu"; import { attachContextMenu } from "preact-context-menu";
import { memo } from "preact/compat"; import { memo } from "preact/compat";
import { useState } from "preact/hooks"; import { useEffect, useState } from "preact/hooks";
import { internalEmit } from "../../../lib/eventEmitter"; import { internalEmit } from "../../../lib/eventEmitter";
import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice"; import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice";
@ -89,6 +89,7 @@ const Message = observer(
// ! FIXME(?): animate on hover // ! FIXME(?): animate on hover
const [mouseHovering, setAnimate] = useState(false); const [mouseHovering, setAnimate] = useState(false);
useEffect(() => setAnimate(false), [replacement]);
return ( return (
<div id={message._id}> <div id={message._id}>