mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Small fixes and destructuring
This commit is contained in:
parent
1808d38c70
commit
089c4ad009
@ -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;
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user