mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-18 18:59:23 +00:00
Const the active time.
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user