Skip to content

Commit

Permalink
Fix analysis title from board editor
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Oct 5, 2017
1 parent 325a0f6 commit 2714180
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/ui/analyse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface Attrs {
tab?: string
// fen used for placeholder board while loading
curFen?: string
goBack?: string
}

export interface State {
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/ui/training/trainingCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2714180

Please sign in to comment.