Skip to content

Commit

Permalink
ui/editor tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jan 26, 2024
1 parent 6db3f33 commit 5b1473a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ui/editor/src/ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ export default class EditorCtrl {
return `${this.cfg.baseUrl}/${urlFen(fen)}${variant}${orientationParam}`;
}

makeImageUrl = (fen: string, orientation: Color = 'white'): string =>
`${lichess.asset.baseUrl()}/export/fen.gif?fen=${urlFen(fen)}&color=${orientation}`;
makeImageUrl = (fen: string): string =>
`${lichess.asset.baseUrl()}/export/fen.gif?fen=${urlFen(fen)}&color=${this.bottomColor()}`;

bottomColor = (): Color =>
this.chessground ? this.chessground.state.orientation : this.options.orientation || 'white';
Expand Down
3 changes: 1 addition & 2 deletions ui/editor/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,7 @@ function inputs(ctrl: EditorCtrl, fen: string): VNode | undefined {
'a',
{
attrs: {
href: ctrl.makeImageUrl(fen, ctrl.bottomColor()),
rel: 'noopener noreferrer',
href: ctrl.makeImageUrl(fen),
},
},
'SCREENSHOT',
Expand Down

0 comments on commit 5b1473a

Please sign in to comment.