problems: { "mine": [], "others": [] },
// timestamp of oldest showed problem:
cursor: {
- "mine": Number.MAX_SAFE_INTEGER,
- "others": Number.MAX_SAFE_INTEGER
+ mine: Number.MAX_SAFE_INTEGER,
+ others: Number.MAX_SAFE_INTEGER
},
// hasMore == TRUE: a priori there could be more problems to load
- hasMore: { "mine": true, "others": true },
+ hasMore: { mine: true, others: true },
onlyMine: false,
showOne: false,
infoMsg: "",
this.loadVariant(prob.vid, () => {
// Set FEN if possible (might not be correct yet)
if (V.IsGoodFen(prob.fen)) this.setDiagram(prob);
+ else prob.diag = "";
});
},
loadVariant: async function(vid, cb) {
// variant could not be ready, or not defined
if (prob.vid > 0 && this.loadedVar == prob.vid && V.IsGoodFen(prob.fen))
this.setDiagram(prob);
+ else prob.diag = "";
},
setDiagram: function(prob) {
// Condition: prob.fen is correct and global V is ready
data: { prob: this.curproblem },
success: (ret) => {
if (edit) {
- let editedP = this.problems.find(p => p.id == this.curproblem.id);
+ let editedP = this.problems["mine"].find(p => p.id == this.curproblem.id);
this.copyProblem(this.curproblem, editedP);
this.showProblem(editedP);
}