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:
parent
1808d38c70
commit
089c4ad009
@ -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;
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user