mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
Manage state per channel. Closes #2
This commit is contained in:
@@ -10,7 +10,7 @@ import styled, { css } from "styled-components";
|
||||
import { Text } from "preact-i18n";
|
||||
import { useLayoutEffect, useState } from "preact/hooks";
|
||||
|
||||
import { useRenderState } from "../../../../lib/renderer/Singleton";
|
||||
import { getRenderer } from "../../../../lib/renderer/Singleton";
|
||||
|
||||
import Markdown from "../../../markdown/Markdown";
|
||||
import UserShort from "../../user/UserShort";
|
||||
@@ -134,8 +134,8 @@ export const ReplyBase = styled.div<{
|
||||
`;
|
||||
|
||||
export const MessageReply = observer(({ index, channel, id }: Props) => {
|
||||
const view = useRenderState(channel._id);
|
||||
if (view?.type !== "RENDER") return null;
|
||||
const view = getRenderer(channel);
|
||||
if (view.state !== "RENDER") return null;
|
||||
|
||||
const [message, setMessage] = useState<Message | undefined>(undefined);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user