1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

Small fixes and destructuring

This commit is contained in:
Brett Sun 2015-12-17 18:47:47 +01:00
parent 1808d38c70
commit 089c4ad009
2 changed files with 7 additions and 4 deletions

View File

@ -75,7 +75,7 @@ let PieceContainer = React.createClass({
// the piece detail a second time
PieceActions.updatePiece({});
PieceActions.fetchOne(this.props.params.pieceId);
this.loadPiece();
UserActions.fetchCurrentUser();
},
@ -119,6 +119,10 @@ let PieceContainer = React.createClass({
}
},
loadPiece() {
PieceActions.fetchOne(this.props.params.pieceId);
},
render() {
const { currentUser, piece } = this.state;

View File

@ -48,9 +48,8 @@ let PrizePieceList = React.createClass({
},
getButtonSubmit() {
const { currentUser } = this.state;
if (this.state.prize && this.state.prize.active &&
!currentUser.is_jury && !currentUser.is_admin && !currentUser.is_judge){
const { currentUser, prize } = this.state;
if (prize && prize.active && !currentUser.is_jury && !currentUser.is_admin && !currentUser.is_judge) {
return (
<LinkContainer to="/register_piece">
<Button>