import { Component, linkEvent } from 'inferno';
+import { Helmet } from 'inferno-helmet';
import { Subscription } from 'rxjs';
import { retryWhen, delay, take } from 'rxjs/operators';
import {
PasswordChangeForm,
WebSocketJsonResponse,
GetSiteResponse,
-} from '../interfaces';
+ Site,
+} from 'lemmy-js-client';
import { WebSocketService, UserService } from '../services';
import { wsJsonToRes, capitalizeFirstLetter, toast } from '../utils';
import { i18n } from '../i18next';
interface State {
passwordChangeForm: PasswordChangeForm;
loading: boolean;
+ site: Site;
}
export class PasswordChange extends Component<any, State> {
password_verify: undefined,
},
loading: false,
+ site: undefined,
};
constructor(props: any, context: any) {
this.subscription.unsubscribe();
}
+ get documentTitle(): string {
+ if (this.state.site) {
+ return `${i18n.t('password_change')} - ${this.state.site.name}`;
+ } else {
+ return 'Lemmy';
+ }
+ }
+
render() {
return (
<div class="container">
+ <Helmet title={this.documentTitle} />
<div class="row">
<div class="col-12 col-lg-6 offset-lg-3 mb-4">
<h5>{i18n.t('password_change')}</h5>
this.props.history.push('/');
} else if (res.op == UserOperation.GetSite) {
let data = res.data as GetSiteResponse;
- document.title = `${i18n.t('password_change')} - ${data.site.name}`;
+ this.state.site = data.site;
+ this.setState(this.state);
}
}
}