mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
Remove remaining references to useUser(s).
Add Channel object.
This commit is contained in:
@@ -13,7 +13,7 @@ import { useRenderState } from "../../../../lib/renderer/Singleton";
|
||||
|
||||
import { useData } from "../../../../mobx/State";
|
||||
|
||||
import { useForceUpdate, useUser } from "../../../../context/revoltjs/hooks";
|
||||
import { useClient } from "../../../../context/revoltjs/RevoltClient";
|
||||
import { mapMessage, MessageObject } from "../../../../context/revoltjs/util";
|
||||
|
||||
import Markdown from "../../../markdown/Markdown";
|
||||
@@ -124,7 +124,7 @@ export const ReplyBase = styled.div<{
|
||||
`;
|
||||
|
||||
export const MessageReply = observer(({ index, channel, id }: Props) => {
|
||||
const ctx = useForceUpdate();
|
||||
const client = useClient();
|
||||
const view = useRenderState(channel);
|
||||
if (view?.type !== "RENDER") return null;
|
||||
|
||||
@@ -138,7 +138,7 @@ export const MessageReply = observer(({ index, channel, id }: Props) => {
|
||||
if (m) {
|
||||
setMessage(m);
|
||||
} else {
|
||||
ctx.client.channels
|
||||
client.channels
|
||||
.fetchMessage(channel, id)
|
||||
.then((m) => setMessage(mapMessage(m)));
|
||||
}
|
||||
@@ -178,8 +178,7 @@ export const MessageReply = observer(({ index, channel, id }: Props) => {
|
||||
<div
|
||||
className="content"
|
||||
onClick={() => {
|
||||
const obj =
|
||||
ctx.client.channels.get(channel);
|
||||
const obj = client.channels.get(channel);
|
||||
if (obj?.channel_type === "TextChannel") {
|
||||
history.push(
|
||||
`/server/${obj.server}/channel/${obj._id}/${message._id}`,
|
||||
|
||||
Reference in New Issue
Block a user