Const the active time.

This commit is contained in:
Half-Shot
2024-11-05 14:40:29 +00:00
parent 56c40720e8
commit 4db7b4fbf5

View File

@@ -60,6 +60,8 @@ interface RaisedHandInfo {
time: Date;
}
const REACTION_ACTIVE_TIME_MS = 3000;
export const useReactions = (): ReactionsContextType => {
const context = useContext(ReactionsContext);
if (!context) {
@@ -236,7 +238,7 @@ export const ReactionsProvider = ({
setTimeout(() => {
// Clear the reaction after some time.
setReactions(({ [sender]: _unused, ...remaining }) => remaining);
}, 3000);
}, REACTION_ACTIVE_TIME_MS);
return {
...reactions,
[sender]: reaction,