From 271418001f2a16bff1375a8c0b83722e64dc37c1 Mon Sep 17 00:00:00 2001 From: Vincent Velociter Date: Thu, 5 Oct 2017 22:32:41 +0200 Subject: [PATCH] Fix analysis title from board editor --- src/ui/analyse/index.ts | 4 +++- src/ui/training/trainingCtrl.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui/analyse/index.ts b/src/ui/analyse/index.ts index cfe8074ea2..9a5ba83235 100644 --- a/src/ui/analyse/index.ts +++ b/src/ui/analyse/index.ts @@ -29,6 +29,7 @@ export interface Attrs { tab?: string // fen used for placeholder board while loading curFen?: string + goBack?: string } export interface State { @@ -42,10 +43,11 @@ export default { const orientation: Color = vnode.attrs.color || 'white' const fenArg = vnode.attrs.fen const variant = vnode.attrs.variant + const goBack = vnode.attrs.goBack const ply = safeStringToNum(vnode.attrs.ply) const tab = safeStringToNum(vnode.attrs.tab) - const shouldGoBack = gameId !== undefined || fenArg !== undefined + const shouldGoBack = gameId !== undefined || goBack !== undefined if (source === 'online' && gameId) { const now = performance.now() diff --git a/src/ui/training/trainingCtrl.js b/src/ui/training/trainingCtrl.js index cde8402adc..5c6efe23a3 100644 --- a/src/ui/training/trainingCtrl.js +++ b/src/ui/training/trainingCtrl.js @@ -310,7 +310,7 @@ export default function ctrl(vnode) { this.goToAnalysis = function() { const fen = this.data.replay.history[0].fen - router.set(`/analyse/variant/standard/fen/${encodeURIComponent(fen)}?color=${this.data.puzzle.color}`) + router.set(`/analyse/variant/standard/fen/${encodeURIComponent(fen)}?color=${this.data.puzzle.color}&goBack=1`) }.bind(this) if (vnode.attrs.id) {