mirror of
https://github.com/ascribe/onion.git
synced 2025-01-23 08:16:18 +01:00
add componentWillReceiveProps in ikono piece detail again
This commit is contained in:
parent
6102ed3bb4
commit
bd99adf4c9
@ -55,6 +55,14 @@ let IkonotvPieceContainer = React.createClass({
|
|||||||
this.loadPiece();
|
this.loadPiece();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// We need this for when the user clicks on a notification while being in another piece view
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
if(this.props.params.pieceId !== nextProps.params.pieceId) {
|
||||||
|
PieceActions.updatePiece({});
|
||||||
|
PieceActions.fetchOne(nextProps.params.pieceId);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
PieceStore.unlisten(this.onChange);
|
PieceStore.unlisten(this.onChange);
|
||||||
UserStore.unlisten(this.onChange);
|
UserStore.unlisten(this.onChange);
|
||||||
|
Loading…
Reference in New Issue
Block a user