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