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:
parent
4c26dd09e4
commit
8801a27cc6
|
@ -138,7 +138,10 @@ export default Component.extend({
|
||||||
|
|
||||||
// "fast track" to update the current user's reviewable count before the message bus finds out.
|
// "fast track" to update the current user's reviewable count before the message bus finds out.
|
||||||
if (performResult.reviewable_count !== undefined) {
|
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) {
|
if (this.attrs.remove) {
|
||||||
|
|
|
@ -102,7 +102,12 @@ export default Controller.extend({
|
||||||
let newList = this.reviewables.reject((reviewable) => {
|
let newList = this.reviewables.reject((reviewable) => {
|
||||||
return ids.indexOf(reviewable.id) !== -1;
|
return ids.indexOf(reviewable.id) !== -1;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (newList.length === 0) {
|
||||||
|
this.send("refreshRoute");
|
||||||
|
} else {
|
||||||
this.set("reviewables", newList);
|
this.set("reviewables", newList);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
resetTopic() {
|
resetTopic() {
|
||||||
|
|
Loading…
Reference in New Issue