+ gotoPrevNext: function(e, prob, dir) {
+ const startIdx = this.problems.findIndex(p => p.id == prob.id);
+ let nextIdx = startIdx + dir;
+ while (
+ nextIdx >= 0 &&
+ nextIdx < this.problems.length &&
+ ((this.onlyMines && this.problems[nextIdx].uid != this.st.user.id) ||
+ (!this.onlyMines && this.problems[nextIdx].uid == this.st.user.id))
+ )
+ nextIdx += dir;
+ if (nextIdx >= 0 && nextIdx < this.problems.length)
+ this.setHrefPid(this.problems[nextIdx]);
+ else
+ alert(this.st.tr["No more problems"]);
+ },