mirror of
https://github.com/flarum/core.git
synced 2025-08-04 23:47:32 +02:00
Update bower dependencies, fix redraw regression
- In Mithril, `finally` has been removed from promise objects as it is not part of the ES spec. See https://gist.github.com/jish/e9bcd75e391a2b21206b for info on the substitute.
- Fix a regression introduced in e5a7013
which broke some redraws
This commit is contained in:
@@ -87,7 +87,8 @@ export default class ChangeEmailModal extends Modal {
|
||||
|
||||
app.session.user.save({email: this.email()}, {errorHandler: this.onerror.bind(this)})
|
||||
.then(() => this.success = true)
|
||||
.finally(this.loaded.bind(this));
|
||||
.catch(() => {})
|
||||
.then(this.loaded.bind(this));
|
||||
|
||||
// The save method will update the cached email address on the user model...
|
||||
// But in the case of a "sudo" password prompt, we'll still want to have
|
||||
|
@@ -91,6 +91,7 @@ export default class ForgotPasswordModal extends Modal {
|
||||
this.success = true;
|
||||
this.alert = null;
|
||||
})
|
||||
.finally(this.loaded.bind(this));
|
||||
.catch(() => {})
|
||||
.then(this.loaded.bind(this));
|
||||
}
|
||||
}
|
||||
|
@@ -120,7 +120,8 @@ export default class NotificationList extends Component {
|
||||
app.session.user.pushAttributes({newNotificationsCount: 0});
|
||||
app.cache.notifications = notifications.sort((a, b) => b.time() - a.time());
|
||||
})
|
||||
.finally(() => {
|
||||
.catch(() => {})
|
||||
.then(() => {
|
||||
this.loading = false;
|
||||
m.redraw();
|
||||
});
|
||||
|
@@ -91,10 +91,12 @@ export default class UserBio extends Component {
|
||||
if (user.bio() !== value) {
|
||||
this.loading = true;
|
||||
|
||||
user.save({bio: value}).finally(() => {
|
||||
this.loading = false;
|
||||
m.redraw();
|
||||
});
|
||||
user.save({bio: value})
|
||||
.catch(() => {})
|
||||
.then(() => {
|
||||
this.loading = false;
|
||||
m.redraw();
|
||||
});
|
||||
}
|
||||
|
||||
this.editing = false;
|
||||
|
@@ -147,11 +147,14 @@ export default {
|
||||
deleteAction(context) {
|
||||
if (context) context.loading = true;
|
||||
|
||||
return this.delete().then(() => {
|
||||
this.discussion().removePost(this.id());
|
||||
}).finally(() => {
|
||||
if (context) context.loading = false;
|
||||
m.redraw();
|
||||
});
|
||||
return this.delete()
|
||||
.then(() => {
|
||||
this.discussion().removePost(this.id());
|
||||
})
|
||||
.catch(() => {})
|
||||
.then(() => {
|
||||
if (context) context.loading = false;
|
||||
m.redraw();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user