fix broadcast multiboard show last position of mainline

pull/9617/head^2
Thibault Duplessis 2021-08-21 11:07:35 +02:00
parent 8631b6028d
commit 119b26f3b8
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ final class StudyMultiBoard(
"args" -> $arr("$root", "$tags"),
"body" -> """function(root, tags) {
|tags = tags.filter(t => t.startsWith('White') || t.startsWith('Black') || t.startsWith('Result'));
|const node = tags.length ? Object.keys(root).reduce((acc, i) => (root[i].p > acc.p) ? root[i] : acc, root['_']) : root['_'];
|const node = tags.length ? Object.keys(root).reduce(([path, node], i) => (root[i].p > node.p && i.startsWith(path)) ? [i, root[i]] : [path, node], ['', root['_']])[1] : root['_'];
|return {node:{fen:node.f,uci:node.u},tags} }""".stripMargin
)
),