Attach timer finished state once
parent
8bb860e870
commit
c2ad9d4f53
|
@ -76,6 +76,7 @@ export default class TypingStore {
|
||||||
currentTyping.isTyping = isTyping;
|
currentTyping.isTyping = isTyping;
|
||||||
|
|
||||||
if (isTyping) {
|
if (isTyping) {
|
||||||
|
if (!currentTyping.serverTimer.isRunning()) {
|
||||||
currentTyping.serverTimer.restart().finished().then(() => {
|
currentTyping.serverTimer.restart().finished().then(() => {
|
||||||
const currentTyping = this._typingStates[roomId];
|
const currentTyping = this._typingStates[roomId];
|
||||||
if (currentTyping) currentTyping.isTyping = false;
|
if (currentTyping) currentTyping.isTyping = false;
|
||||||
|
@ -83,10 +84,13 @@ export default class TypingStore {
|
||||||
// The server will (should) time us out on typing, so we don't
|
// The server will (should) time us out on typing, so we don't
|
||||||
// need to advertise a stop of typing.
|
// need to advertise a stop of typing.
|
||||||
});
|
});
|
||||||
|
} else currentTyping.serverTimer.restart();
|
||||||
|
|
||||||
|
if (!currentTyping.userTimer.isRunning()) {
|
||||||
currentTyping.userTimer.restart().finished().then(() => {
|
currentTyping.userTimer.restart().finished().then(() => {
|
||||||
this.setSelfTyping(roomId, false);
|
this.setSelfTyping(roomId, false);
|
||||||
});
|
});
|
||||||
|
} else currentTyping.userTimer.restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
MatrixClientPeg.get().sendTyping(roomId, isTyping, TYPING_SERVER_TIMEOUT);
|
MatrixClientPeg.get().sendTyping(roomId, isTyping, TYPING_SERVER_TIMEOUT);
|
||||||
|
|
Loading…
Reference in New Issue