mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 17:35:28 +00:00
Zero error milestone.
This commit is contained in:
@@ -14,7 +14,6 @@ import { StateUpdater, useEffect } from "preact/hooks";
|
||||
import { internalSubscribe } from "../../../../lib/eventEmitter";
|
||||
import { useRenderState } from "../../../../lib/renderer/Singleton";
|
||||
|
||||
import { useData } from "../../../../mobx/State";
|
||||
import { Reply } from "../../../../redux/reducers/queue";
|
||||
|
||||
import IconButton from "../../../ui/IconButton";
|
||||
@@ -74,9 +73,6 @@ export default observer(({ channel, replies, setReplies }: Props) => {
|
||||
const ids = replies.map((x) => x.id);
|
||||
const messages = view.messages.filter((x) => ids.includes(x._id));
|
||||
|
||||
const store = useData();
|
||||
const users = messages.map((x) => store.users.get(x.author));
|
||||
|
||||
return (
|
||||
<div>
|
||||
{replies.map((reply, index) => {
|
||||
@@ -92,17 +88,16 @@ export default observer(({ channel, replies, setReplies }: Props) => {
|
||||
</span>
|
||||
);
|
||||
|
||||
const user = users[index];
|
||||
return (
|
||||
<Base key={reply.id}>
|
||||
<ReplyBase preview>
|
||||
<ReplyIcon size={22} />
|
||||
<UserShort user={user} size={16} />
|
||||
<UserShort user={message.author} size={16} />
|
||||
{message.attachments &&
|
||||
message.attachments.length > 0 && (
|
||||
<File size={16} />
|
||||
)}
|
||||
{message.author === SYSTEM_USER_ID ? (
|
||||
{message.author_id === SYSTEM_USER_ID ? (
|
||||
<SystemMessage message={message} />
|
||||
) : (
|
||||
<Markdown
|
||||
|
||||
@@ -1,22 +1,12 @@
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { User } from "revolt.js";
|
||||
import styled from "styled-components";
|
||||
|
||||
import { Text } from "preact-i18n";
|
||||
import { useContext } from "preact/hooks";
|
||||
|
||||
import { TextReact } from "../../../../lib/i18n";
|
||||
|
||||
import { useData } from "../../../../mobx/State";
|
||||
import { connectState } from "../../../../redux/connector";
|
||||
import { TypingUser } from "../../../../redux/reducers/typing";
|
||||
|
||||
import {
|
||||
AppContext,
|
||||
useClient,
|
||||
} from "../../../../context/revoltjs/RevoltClient";
|
||||
|
||||
import { Username } from "../../user/UserShort";
|
||||
import { useClient } from "../../../../context/revoltjs/RevoltClient";
|
||||
|
||||
interface Props {
|
||||
typing?: TypingUser[];
|
||||
@@ -68,9 +58,8 @@ const Base = styled.div`
|
||||
export const TypingIndicator = observer(({ typing }: Props) => {
|
||||
if (typing && typing.length > 0) {
|
||||
const client = useClient();
|
||||
const store = useData();
|
||||
const users = typing
|
||||
.map((x) => store.users.get(x.id)!)
|
||||
.map((x) => client.users.get(x.id)!)
|
||||
.filter((x) => typeof x !== "undefined");
|
||||
|
||||
users.sort((a, b) =>
|
||||
@@ -113,11 +102,7 @@ export const TypingIndicator = observer(({ typing }: Props) => {
|
||||
{users.map((user) => (
|
||||
<img
|
||||
loading="eager"
|
||||
src={client.users.getAvatarURL(
|
||||
user._id,
|
||||
{ max_side: 256 },
|
||||
true,
|
||||
)}
|
||||
src={user.generateAvatarURL({ max_side: 256 })}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user