JS fixes
This commit is contained in:
parent
4bc5cb6918
commit
44d3badcf7
|
@ -2130,7 +2130,7 @@ lichess.storage = {
|
|||
name: "analyse"
|
||||
},
|
||||
params: {
|
||||
ran: "--ranph--",
|
||||
ran: "--ranph--"
|
||||
},
|
||||
receive: function(t, d) {
|
||||
analyse.socketReceive(t, d);
|
||||
|
|
|
@ -38,9 +38,10 @@ module.exports = function(steps, analysis) {
|
|||
});
|
||||
if (curStep) {
|
||||
curStep.variations = curStep.variations || [];
|
||||
if (curStep.san === step.san) return false;;
|
||||
if (curStep.san === step.san) return nextPath;
|
||||
for (var i = 0; i < curStep.variations.length; i++) {
|
||||
if (curStep.variations[i][0].san === step.san) return false;
|
||||
if (curStep.variations[i][0].san === step.san)
|
||||
return treePath.withVariation(nextPath, i + 1);
|
||||
}
|
||||
curStep.variations.push([step]);
|
||||
return treePath.withVariation(nextPath, curStep.variations.length);
|
||||
|
|
|
@ -127,7 +127,6 @@ module.exports = function(opts) {
|
|||
|
||||
this.addStep = function(step, path) {
|
||||
var newPath = this.analyse.addStep(step, treePath.read(path));
|
||||
if (!newPath) return;
|
||||
this.jump(newPath);
|
||||
m.redraw();
|
||||
this.chessground.playPremove();
|
||||
|
|
Loading…
Reference in a new issue