FIX: Automatically load more reviewable items. (#13069)

If you finished reviewing the initially loaded items, and there're more in the queue, load them.

Also, when fast-tracking the pending items updates, use the reviewable_count returned by the perform result. Calling "result.reviewable_count" returns undefines.
This commit is contained in:
Roman Rizzi 2021-05-14 15:06:34 -03:00 committed by GitHub
parent 4c26dd09e4
commit 8801a27cc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -138,7 +138,10 @@ export default Component.extend({
// "fast track" to update the current user's reviewable count before the message bus finds out.
if (performResult.reviewable_count !== undefined) {
this.currentUser.set("reviewable_count", result.reviewable_count);
this.currentUser.set(
"reviewable_count",
performResult.reviewable_count
);
}
if (this.attrs.remove) {

View File

@ -102,7 +102,12 @@ export default Controller.extend({
let newList = this.reviewables.reject((reviewable) => {
return ids.indexOf(reviewable.id) !== -1;
});
this.set("reviewables", newList);
if (newList.length === 0) {
this.send("refreshRoute");
} else {
this.set("reviewables", newList);
}
},
resetTopic() {