expireMs -> expireTs
This commit is contained in:
parent
1546cb2923
commit
67ecf9db62
1 changed files with 3 additions and 3 deletions
|
@ -39,7 +39,7 @@ export default class TypingStore {
|
||||||
* MatrixClientPeg client changes.
|
* MatrixClientPeg client changes.
|
||||||
*/
|
*/
|
||||||
reset() {
|
reset() {
|
||||||
this._typingStates = {}; // roomId => { isTyping, expireMs }
|
this._typingStates = {}; // roomId => { isTyping, expireTs }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,7 +60,7 @@ export default class TypingStore {
|
||||||
const now = new Date().getTime();
|
const now = new Date().getTime();
|
||||||
this._typingStates[roomId] = {
|
this._typingStates[roomId] = {
|
||||||
isTyping: isTyping,
|
isTyping: isTyping,
|
||||||
expireMs: now + TYPING_SERVER_TIMEOUT,
|
expireTs: now + TYPING_SERVER_TIMEOUT,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isTyping) {
|
if (isTyping) {
|
||||||
|
@ -68,7 +68,7 @@ export default class TypingStore {
|
||||||
const currentTyping = this._typingStates[roomId];
|
const currentTyping = this._typingStates[roomId];
|
||||||
const now = new Date().getTime();
|
const now = new Date().getTime();
|
||||||
|
|
||||||
if (currentTyping && currentTyping.expireMs >= now) {
|
if (currentTyping && currentTyping.expireTs >= now) {
|
||||||
currentTyping.isTyping = false;
|
currentTyping.isTyping = false;
|
||||||
}
|
}
|
||||||
}, TYPING_SERVER_TIMEOUT);
|
}, TYPING_SERVER_TIMEOUT);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue