- if (response.problems.length > 0)
- {
- Array.prototype.push.apply(problems,
- response.problems.sort((p1,p2) => { return p2.added - p1.added; }));
- // If one list is empty but not the other, show the non-empty
- const otherArray = (type == "mine" ? this.problems : this.myProblems);
- if (problems.length > 0 && otherArray.length == 0)
- this.display = type;
- }
+ if (response.problems.length == 0)
+ return this.noMoreProblems("No more problems in this direction");
+ Array.prototype.push.apply(problems,
+ response.problems.sort((p1,p2) => { return p2.added - p1.added; }));
+ // If one list is empty but not the other, show the non-empty
+ const otherArray = (type == "mine" ? this.problems : this.myProblems);
+ if (problems.length > 0 && otherArray.length == 0)
+ this.display = type;
+ if (!!cb)
+ cb();
+ else
+ this.$forceUpdate(); //TODO...