fix: no client context on ModifyAccount

fix: no reactivity on account settings

closes #706
fixes #683
fixes #702
This commit is contained in:
Paul Makles
2022-06-21 10:57:58 +01:00
parent aa9974149c
commit cb0a521473
3 changed files with 7 additions and 6 deletions

View File

@@ -7,6 +7,8 @@ import { Category, Error, Modal } from "@revoltchat/ui";
import { noopTrue } from "../../../lib/js";
import { useApplicationState } from "../../../mobx/State";
import FormField from "../../../pages/login/FormField";
import { AppContext } from "../../revoltjs/RevoltClient";
import { takeError } from "../../revoltjs/util";
@@ -27,7 +29,7 @@ export default function ModifyAccount({
field,
...props
}: ModalProps<"modify_account">) {
const client = useContext(AppContext);
const client = useApplicationState().client!;
const [processing, setProcessing] = useState(false);
const { handleSubmit, register, errors } = useForm<FormInputs>();
const [error, setError] = useState<string | undefined>(undefined);