1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 17:36:38 +02:00

update: forum/components/ChangeEmailModal

This commit is contained in:
Alexander Skvortsov
2020-08-10 00:17:00 -04:00
committed by Franz Liedke
parent eb627544fa
commit 0172dfd79c

View File

@@ -6,8 +6,8 @@ import Button from '../../common/components/Button';
* to change their email address. * to change their email address.
*/ */
export default class ChangeEmailModal extends Modal { export default class ChangeEmailModal extends Modal {
init() { oninit(vnode) {
super.init(); super.oninit(vnode);
/** /**
* Whether or not the email has been changed successfully. * Whether or not the email has been changed successfully.
@@ -21,14 +21,14 @@ export default class ChangeEmailModal extends Modal {
* *
* @type {function} * @type {function}
*/ */
this.email = m.prop(app.session.user.email()); this.email = m.stream(app.session.user.email());
/** /**
* The value of the password input. * The value of the password input.
* *
* @type {function} * @type {function}
*/ */
this.password = m.prop(''); this.password = m.stream('');
} }
className() { className() {
@@ -81,12 +81,14 @@ export default class ChangeEmailModal extends Modal {
/> />
</div> </div>
<div className="Form-group"> <div className="Form-group">
{Button.component({ {Button.component(
className: 'Button Button--primary Button--block', {
type: 'submit', className: 'Button Button--primary Button--block',
loading: this.loading, type: 'submit',
children: app.translator.trans('core.forum.change_email.submit_button'), loading: this.loading,
})} },
app.translator.trans('core.forum.change_email.submit_button')
)}
</div> </div>
</div> </div>
</div> </div>
@@ -122,7 +124,7 @@ export default class ChangeEmailModal extends Modal {
onerror(error) { onerror(error) {
if (error.status === 401) { if (error.status === 401) {
error.alert.children = app.translator.trans('core.forum.change_email.incorrect_password_message'); error.alert.content = app.translator.trans('core.forum.change_email.incorrect_password_message');
} }
super.onerror(error); super.onerror(error);