mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-08 01:45:28 +00:00
chore: delete intermediate
This commit is contained in:
@@ -21,8 +21,6 @@ import { voiceState, VoiceStatus } from "../../../lib/vortex/VoiceState";
|
||||
import { useApplicationState } from "../../../mobx/State";
|
||||
import { SIDEBAR_MEMBERS } from "../../../mobx/stores/Layout";
|
||||
|
||||
import { useIntermediate } from "../../../context/intermediate/Intermediate";
|
||||
|
||||
import UpdateIndicator from "../../../components/common/UpdateIndicator";
|
||||
import { modalController } from "../../../controllers/modals/ModalController";
|
||||
import { ChannelHeaderProps } from "../ChannelHeader";
|
||||
@@ -74,7 +72,6 @@ const SearchBar = styled.div`
|
||||
|
||||
export default function HeaderActions({ channel }: ChannelHeaderProps) {
|
||||
const layout = useApplicationState().layout;
|
||||
const { openScreen } = useIntermediate();
|
||||
const history = useHistory();
|
||||
|
||||
function slideOpen() {
|
||||
|
||||
@@ -23,10 +23,9 @@ import { internalEmit, internalSubscribe } from "../../../lib/eventEmitter";
|
||||
import { getRenderer } from "../../../lib/renderer/Singleton";
|
||||
import { ScrollState } from "../../../lib/renderer/types";
|
||||
|
||||
import { IntermediateContext } from "../../../context/intermediate/Intermediate";
|
||||
|
||||
import { useSession } from "../../../controllers/client/ClientController";
|
||||
import RequiresOnline from "../../../controllers/client/jsx/RequiresOnline";
|
||||
import { modalController } from "../../../controllers/modals/ModalController";
|
||||
import ConversationStart from "./ConversationStart";
|
||||
import MessageRenderer from "./MessageRenderer";
|
||||
|
||||
@@ -63,7 +62,6 @@ export const MESSAGE_AREA_PADDING = 82;
|
||||
export const MessageArea = observer(({ last_id, channel }: Props) => {
|
||||
const history = useHistory();
|
||||
const session = useSession()!;
|
||||
const { focusTaken } = useContext(IntermediateContext);
|
||||
|
||||
// ? Required data for message links.
|
||||
const { message } = useParams<{ message: string }>();
|
||||
@@ -303,7 +301,7 @@ export const MessageArea = observer(({ last_id, channel }: Props) => {
|
||||
// ? Scroll to bottom when pressing 'Escape'.
|
||||
useEffect(() => {
|
||||
function keyUp(e: KeyboardEvent) {
|
||||
if (e.key === "Escape" && !focusTaken) {
|
||||
if (e.key === "Escape" && !modalController.isVisible) {
|
||||
renderer.jumpToBottom(true);
|
||||
internalEmit("TextArea", "focus", "message");
|
||||
}
|
||||
@@ -311,7 +309,7 @@ export const MessageArea = observer(({ last_id, channel }: Props) => {
|
||||
|
||||
document.body.addEventListener("keyup", keyUp);
|
||||
return () => document.body.removeEventListener("keyup", keyUp);
|
||||
}, [renderer, ref, focusTaken]);
|
||||
}, [renderer, ref]);
|
||||
|
||||
return (
|
||||
<MessageAreaWidthContext.Provider
|
||||
|
||||
@@ -6,11 +6,6 @@ import { useContext, useEffect, useState } from "preact/hooks";
|
||||
import TextAreaAutoSize from "../../../lib/TextAreaAutoSize";
|
||||
import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice";
|
||||
|
||||
import {
|
||||
IntermediateContext,
|
||||
useIntermediate,
|
||||
} from "../../../context/intermediate/Intermediate";
|
||||
|
||||
import AutoComplete, {
|
||||
useAutoComplete,
|
||||
} from "../../../components/common/AutoComplete";
|
||||
@@ -50,7 +45,6 @@ interface Props {
|
||||
|
||||
export default function MessageEditor({ message, finish }: Props) {
|
||||
const [content, setContent] = useState(message.content ?? "");
|
||||
const { focusTaken } = useContext(IntermediateContext);
|
||||
|
||||
async function save() {
|
||||
finish();
|
||||
@@ -70,14 +64,14 @@ export default function MessageEditor({ message, finish }: Props) {
|
||||
// ? Stop editing when pressing ESC.
|
||||
useEffect(() => {
|
||||
function keyUp(e: KeyboardEvent) {
|
||||
if (e.key === "Escape" && !focusTaken) {
|
||||
if (e.key === "Escape" && !modalController.isVisible) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
document.body.addEventListener("keyup", keyUp);
|
||||
return () => document.body.removeEventListener("keyup", keyUp);
|
||||
}, [focusTaken, finish]);
|
||||
}, [finish]);
|
||||
|
||||
const {
|
||||
onChange,
|
||||
|
||||
@@ -16,8 +16,6 @@ import { Button } from "@revoltchat/ui";
|
||||
|
||||
import { voiceState, VoiceStatus } from "../../../lib/vortex/VoiceState";
|
||||
|
||||
import { useIntermediate } from "../../../context/intermediate/Intermediate";
|
||||
|
||||
import Tooltip from "../../../components/common/Tooltip";
|
||||
import UserIcon from "../../../components/common/user/UserIcon";
|
||||
import { useClient } from "../../../controllers/client/ClientController";
|
||||
@@ -85,8 +83,6 @@ const VoiceBase = styled.div`
|
||||
export default observer(({ id }: Props) => {
|
||||
if (voiceState.roomId !== id) return null;
|
||||
|
||||
const { openScreen } = useIntermediate();
|
||||
|
||||
const client = useClient();
|
||||
const self = client.users.get(client.user!._id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user