Fix blocked users appearing in typing indicator.

Make typing indicator time out.
This commit is contained in:
Paul
2021-07-31 17:58:26 +01:00
parent 50452ba503
commit f20f1d8b41
5 changed files with 102 additions and 93 deletions

View File

@@ -323,7 +323,7 @@ export default observer(({ channel }: Props) => {
const ws = client.websocket;
if (ws.connected) {
setTyping(+new Date() + 4000);
setTyping(+new Date() + 2500);
ws.send({
type: "BeginTyping",
channel: channel._id,

View File

@@ -1,4 +1,5 @@
import { observer } from "mobx-react-lite";
import { RelationshipStatus } from "revolt-api/types/Users";
import { Channel } from "revolt.js/dist/maps/Channels";
import styled from "styled-components";
@@ -57,7 +58,10 @@ const Base = styled.div`
export default observer(({ channel }: Props) => {
const users = channel.typing.filter(
(x) => typeof x !== "undefined" && x._id !== x.client.user!._id,
(x) =>
typeof x !== "undefined" &&
x._id !== x.client.user!._id &&
x.relationship !== RelationshipStatus.Blocked,
);
if (users.length > 0) {