mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-09 02:05:28 +00:00
fix: no client context on ModifyAccount
fix: no reactivity on account settings closes #706 fixes #683 fixes #702
This commit is contained in:
2
external/lang
vendored
2
external/lang
vendored
Submodule external/lang updated: ae44e2b179...50838167d7
@@ -1,5 +1,6 @@
|
|||||||
import { At } from "@styled-icons/boxicons-regular";
|
import { At } from "@styled-icons/boxicons-regular";
|
||||||
import { Envelope, Key, Pencil } from "@styled-icons/boxicons-solid";
|
import { Envelope, Key, Pencil } from "@styled-icons/boxicons-solid";
|
||||||
|
import { observer } from "mobx-react-lite";
|
||||||
|
|
||||||
import { Text } from "preact-i18n";
|
import { Text } from "preact-i18n";
|
||||||
import { useContext, useEffect, useState } from "preact/hooks";
|
import { useContext, useEffect, useState } from "preact/hooks";
|
||||||
@@ -11,7 +12,6 @@ import {
|
|||||||
HiddenValue,
|
HiddenValue,
|
||||||
} from "@revoltchat/ui";
|
} from "@revoltchat/ui";
|
||||||
|
|
||||||
import { useIntermediate } from "../../../context/intermediate/Intermediate";
|
|
||||||
import { modalController } from "../../../context/modals";
|
import { modalController } from "../../../context/modals";
|
||||||
import {
|
import {
|
||||||
ClientStatus,
|
ClientStatus,
|
||||||
@@ -19,10 +19,9 @@ import {
|
|||||||
useClient,
|
useClient,
|
||||||
} from "../../../context/revoltjs/RevoltClient";
|
} from "../../../context/revoltjs/RevoltClient";
|
||||||
|
|
||||||
export default function EditAccount() {
|
export default observer(() => {
|
||||||
const client = useClient();
|
const client = useClient();
|
||||||
const status = useContext(StatusContext);
|
const status = useContext(StatusContext);
|
||||||
const { openScreen } = useIntermediate();
|
|
||||||
|
|
||||||
const [email, setEmail] = useState("...");
|
const [email, setEmail] = useState("...");
|
||||||
|
|
||||||
@@ -74,4 +73,4 @@ export default function EditAccount() {
|
|||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import { Category, Error, Modal } from "@revoltchat/ui";
|
|||||||
|
|
||||||
import { noopTrue } from "../../../lib/js";
|
import { noopTrue } from "../../../lib/js";
|
||||||
|
|
||||||
|
import { useApplicationState } from "../../../mobx/State";
|
||||||
|
|
||||||
import FormField from "../../../pages/login/FormField";
|
import FormField from "../../../pages/login/FormField";
|
||||||
import { AppContext } from "../../revoltjs/RevoltClient";
|
import { AppContext } from "../../revoltjs/RevoltClient";
|
||||||
import { takeError } from "../../revoltjs/util";
|
import { takeError } from "../../revoltjs/util";
|
||||||
@@ -27,7 +29,7 @@ export default function ModifyAccount({
|
|||||||
field,
|
field,
|
||||||
...props
|
...props
|
||||||
}: ModalProps<"modify_account">) {
|
}: ModalProps<"modify_account">) {
|
||||||
const client = useContext(AppContext);
|
const client = useApplicationState().client!;
|
||||||
const [processing, setProcessing] = useState(false);
|
const [processing, setProcessing] = useState(false);
|
||||||
const { handleSubmit, register, errors } = useForm<FormInputs>();
|
const { handleSubmit, register, errors } = useForm<FormInputs>();
|
||||||
const [error, setError] = useState<string | undefined>(undefined);
|
const [error, setError] = useState<string | undefined>(undefined);
|
||||||
|
|||||||
Reference in New Issue
Block a user