mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
feat: implement useClient from client controller
This commit is contained in:
@@ -28,7 +28,6 @@ import styled from "styled-components/macro";
|
||||
import styles from "./Settings.module.scss";
|
||||
import { openContextMenu } from "preact-context-menu";
|
||||
import { Text } from "preact-i18n";
|
||||
import { useContext } from "preact/hooks";
|
||||
|
||||
import { LineDivider } from "@revoltchat/ui";
|
||||
|
||||
@@ -36,12 +35,15 @@ import { useApplicationState } from "../../mobx/State";
|
||||
|
||||
import { useIntermediate } from "../../context/intermediate/Intermediate";
|
||||
import RequiresOnline from "../../context/revoltjs/RequiresOnline";
|
||||
import { AppContext, LogOutContext } from "../../context/revoltjs/RevoltClient";
|
||||
|
||||
import UserIcon from "../../components/common/user/UserIcon";
|
||||
import { Username } from "../../components/common/user/UserShort";
|
||||
import UserStatus from "../../components/common/user/UserStatus";
|
||||
import ButtonItem from "../../components/navigation/items/ButtonItem";
|
||||
import {
|
||||
useClient,
|
||||
clientController,
|
||||
} from "../../controllers/client/ClientController";
|
||||
import { modalController } from "../../controllers/modals/ModalController";
|
||||
import { GIT_BRANCH, GIT_REVISION, REPO_URL } from "../../revision";
|
||||
import { APP_VERSION } from "../../version";
|
||||
@@ -118,8 +120,7 @@ const AccountHeader = styled.div`
|
||||
|
||||
export default observer(() => {
|
||||
const history = useHistory();
|
||||
const client = useContext(AppContext);
|
||||
const logout = useContext(LogOutContext);
|
||||
const client = useClient();
|
||||
const { openScreen } = useIntermediate();
|
||||
const experiments = useApplicationState().experiments;
|
||||
|
||||
@@ -288,7 +289,7 @@ export default observer(() => {
|
||||
</a>
|
||||
<LineDivider compact />
|
||||
<ButtonItem
|
||||
onClick={() => logout()}
|
||||
onClick={clientController.logoutCurrent}
|
||||
className={styles.logOut}
|
||||
compact>
|
||||
<LogOut size={20} />
|
||||
|
||||
Reference in New Issue
Block a user