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;
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));
}
}

View File

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