mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Attach timer finished state once
This commit is contained in:
parent
8bb860e870
commit
c2ad9d4f53
1 changed files with 13 additions and 9 deletions
|
@ -76,17 +76,21 @@ export default class TypingStore {
|
|||
currentTyping.isTyping = isTyping;
|
||||
|
||||
if (isTyping) {
|
||||
currentTyping.serverTimer.restart().finished().then(() => {
|
||||
const currentTyping = this._typingStates[roomId];
|
||||
if (currentTyping) currentTyping.isTyping = false;
|
||||
if (!currentTyping.serverTimer.isRunning()) {
|
||||
currentTyping.serverTimer.restart().finished().then(() => {
|
||||
const currentTyping = this._typingStates[roomId];
|
||||
if (currentTyping) currentTyping.isTyping = false;
|
||||
|
||||
// The server will (should) time us out on typing, so we don't
|
||||
// need to advertise a stop of typing.
|
||||
});
|
||||
// The server will (should) time us out on typing, so we don't
|
||||
// need to advertise a stop of typing.
|
||||
});
|
||||
} else currentTyping.serverTimer.restart();
|
||||
|
||||
currentTyping.userTimer.restart().finished().then(() => {
|
||||
this.setSelfTyping(roomId, false);
|
||||
});
|
||||
if (!currentTyping.userTimer.isRunning()) {
|
||||
currentTyping.userTimer.restart().finished().then(() => {
|
||||
this.setSelfTyping(roomId, false);
|
||||
});
|
||||
} else currentTyping.userTimer.restart();
|
||||
}
|
||||
|
||||
MatrixClientPeg.get().sendTyping(roomId, isTyping, TYPING_SERVER_TIMEOUT);
|
||||
|
|
Loading…
Reference in a new issue