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:
@@ -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));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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();
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user