mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
clearTimout call added to checkExpired to avoid multiple calls to setExpired
This commit is contained in:
parent
d7eafb7e15
commit
751d0b9348
|
@ -133,6 +133,9 @@ class MessageInner extends React.PureComponent<MessageRegularProps, State> {
|
|||
const convo = getConversationController().get(convoId);
|
||||
convo.updateLastMessage();
|
||||
};
|
||||
// as 'checkExpired' is potentially called more than once (componentDidUpdate & componentDidMount),
|
||||
// we need to clear the timeout call to 'setExpired' first to avoid multiple calls to 'setExpired'.
|
||||
clearTimeout(this.expiredTimeout);
|
||||
this.expiredTimeout = setTimeout(setExpired, EXPIRED_DELAY);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue