X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fperson%2Fpassword-change.tsx;h=16f23d4b85c9dc2d25d3de79437ff4fc0ddc5415;hb=61e0241d8930badc4a77cd973c3cbb64bd13c49e;hp=9f5bf9277d0247982667fbb41d3fcf7b01c117c5;hpb=9265fc58948341856513c06ba44e1a0c0d5a4241;p=lemmy-ui.git diff --git a/src/shared/components/person/password-change.tsx b/src/shared/components/person/password-change.tsx index 9f5bf92..16f23d4 100644 --- a/src/shared/components/person/password-change.tsx +++ b/src/shared/components/person/password-change.tsx @@ -1,11 +1,12 @@ +import { myAuth, setIsoData } from "@utils/app"; +import { capitalizeFirstLetter } from "@utils/helpers"; import { Component, linkEvent } from "inferno"; import { GetSiteResponse, LoginResponse } from "lemmy-js-client"; -import { i18n } from "../../i18next"; -import { HttpService, UserService } from "../../services"; +import { HttpService, I18NextService, UserService } from "../../services"; import { RequestState } from "../../services/HttpService"; -import { capitalizeFirstLetter, myAuth, setIsoData } from "../../utils"; import { HtmlTags } from "../common/html-tags"; import { Spinner } from "../common/icon"; +import PasswordInput from "../common/password-input"; interface State { passwordChangeRes: RequestState; @@ -33,21 +34,23 @@ export class PasswordChange extends Component { } get documentTitle(): string { - return `${i18n.t("password_change")} - ${ + return `${I18NextService.i18n.t("password_change")} - ${ this.state.siteRes.site_view.site.name }`; } render() { return ( -
+
-
{i18n.t("password_change")}
+

+ {I18NextService.i18n.t("password_change")} +

{this.passwordChangeForm()}
@@ -58,45 +61,31 @@ export class PasswordChange extends Component { passwordChangeForm() { return (
-
- -
- -
+
+
-
- -
- -
+
+
-
+
@@ -133,14 +122,16 @@ export class PasswordChange extends Component { if (i.state.passwordChangeRes.state === "success") { const data = i.state.passwordChangeRes.data; - UserService.Instance.login(data); + UserService.Instance.login({ + res: data, + }); const site = await HttpService.client.getSite({ auth: myAuth() }); if (site.state === "success") { UserService.Instance.myUserInfo = site.data.my_user; } - this.props.history.replace("/"); + i.props.history.replace("/"); } } }