From 88b525f35289cd483ffa8db0467287828c1a2f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 25 Aug 2015 17:22:32 +0200 Subject: [PATCH] change link in accordionlist item dependent on domain --- .../accordion_list_item_piece.js | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item_piece.js b/js/components/ascribe_accordion_list/accordion_list_item_piece.js index b7e621b8..d0b16c9f 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_piece.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_piece.js @@ -26,13 +26,24 @@ let AccordionListItemPiece = React.createClass({ mixins: [Router.Navigation], - getLinkData(){ - return { - to: 'piece', - params: { - pieceId: this.props.piece.id - } - }; + getLinkData() { + + if(this.props.piece && this.props.piece.first_edition) { + return { + to: 'edition', + params: { + editionId: this.props.piece.first_edition.bitcoin_id + } + }; + } else { + return { + to: 'piece', + params: { + pieceId: this.props.piece.id + } + }; + } + }, render() {