1
0
mirror of https://github.com/flarum/core.git synced 2025-08-04 15:37:51 +02:00

Use more concise error handling

This commit is contained in:
Toby Zerner
2015-10-20 12:50:04 +10:30
parent e357d2b535
commit 726d17dc4a
2 changed files with 7 additions and 11 deletions

View File

@@ -70,12 +70,11 @@ export default class FlagList extends Component {
this.loading = true; this.loading = true;
m.redraw(); m.redraw();
app.store.find('flags').then(flags => { app.store.find('flags')
app.session.user.pushAttributes({newFlagsCount: 0}); .then(flags => {
app.cache.flags = flags.sort((a, b) => b.time() - a.time()); app.session.user.pushAttributes({newFlagsCount: 0});
app.cache.flags = flags.sort((a, b) => b.time() - a.time());
this.loading = false; })
m.redraw(); .finally(this.loaded.bind(this));
});
} }
} }

View File

@@ -77,10 +77,7 @@ export default class FlagPostModal extends Modal {
} }
}).then( }).then(
() => this.hide(), () => this.hide(),
() => { this.loaded.bind(this)
this.loading = false;
m.redraw();
}
); );
} }
} }