1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +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 // the piece detail a second time
PieceActions.updatePiece({}); PieceActions.updatePiece({});
PieceActions.fetchOne(this.props.params.pieceId); this.loadPiece();
UserActions.fetchCurrentUser(); UserActions.fetchCurrentUser();
}, },
@ -119,6 +119,10 @@ let PieceContainer = React.createClass({
} }
}, },
loadPiece() {
PieceActions.fetchOne(this.props.params.pieceId);
},
render() { render() {
const { currentUser, piece } = this.state; const { currentUser, piece } = this.state;

View File

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