X-Git-Url: http://these/git/?a=blobdiff_plain;f=src%2Fshared%2Fcomponents%2Fperson%2Fpassword-change.tsx;h=9f5bf9277d0247982667fbb41d3fcf7b01c117c5;hb=2b1af707c3df6126b3e6890106c03c60ad49b1be;hp=743fef38e83a29b48c6e909e35dd9a588b7898b9;hpb=f61037f5d89f12818c8100f907a98b74e980112a;p=lemmy-ui.git diff --git a/src/shared/components/person/password-change.tsx b/src/shared/components/person/password-change.tsx index 743fef3..9f5bf92 100644 --- a/src/shared/components/person/password-change.tsx +++ b/src/shared/components/person/password-change.tsx @@ -1,59 +1,35 @@ import { Component, linkEvent } from "inferno"; -import { - GetSiteResponse, - LoginResponse, - PasswordChangeAfterReset, - UserOperation, - wsJsonToRes, - wsUserOp, -} from "lemmy-js-client"; -import { Subscription } from "rxjs"; +import { GetSiteResponse, LoginResponse } from "lemmy-js-client"; import { i18n } from "../../i18next"; -import { UserService, WebSocketService } from "../../services"; -import { - capitalizeFirstLetter, - isBrowser, - setIsoData, - toast, - wsClient, - wsSubscribe, -} from "../../utils"; +import { HttpService, 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"; interface State { + passwordChangeRes: RequestState; form: { token: string; password?: string; password_verify?: string; }; - loading: boolean; siteRes: GetSiteResponse; } export class PasswordChange extends Component { private isoData = setIsoData(this.context); - private subscription?: Subscription; state: State = { + passwordChangeRes: { state: "empty" }, + siteRes: this.isoData.site_res, form: { token: this.props.match.params.token, }, - loading: false, - siteRes: this.isoData.site_res, }; constructor(props: any, context: any) { super(props, context); - - this.parseMessage = this.parseMessage.bind(this); - this.subscription = wsSubscribe(this.parseMessage); - } - - componentWillUnmount() { - if (isBrowser()) { - this.subscription?.unsubscribe(); - } } get documentTitle(): string { @@ -117,7 +93,7 @@ export class PasswordChange extends Component {