mirror of
https://github.com/flarum/framework.git
synced 2025-03-15 00:05:12 +08:00
Use more concise error handling
This commit is contained in:
parent
e357d2b535
commit
726d17dc4a
@ -70,12 +70,11 @@ export default class FlagList extends Component {
|
||||
this.loading = true;
|
||||
m.redraw();
|
||||
|
||||
app.store.find('flags').then(flags => {
|
||||
app.session.user.pushAttributes({newFlagsCount: 0});
|
||||
app.cache.flags = flags.sort((a, b) => b.time() - a.time());
|
||||
|
||||
this.loading = false;
|
||||
m.redraw();
|
||||
});
|
||||
app.store.find('flags')
|
||||
.then(flags => {
|
||||
app.session.user.pushAttributes({newFlagsCount: 0});
|
||||
app.cache.flags = flags.sort((a, b) => b.time() - a.time());
|
||||
})
|
||||
.finally(this.loaded.bind(this));
|
||||
}
|
||||
}
|
||||
|
@ -77,10 +77,7 @@ export default class FlagPostModal extends Modal {
|
||||
}
|
||||
}).then(
|
||||
() => this.hide(),
|
||||
() => {
|
||||
this.loading = false;
|
||||
m.redraw();
|
||||
}
|
||||
this.loaded.bind(this)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user