1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

add componentWillReceiveProps in ikono piece detail again

This commit is contained in:
Tim Daubenschütz 2015-09-21 16:25:28 +02:00
parent 6102ed3bb4
commit bd99adf4c9

View File

@ -55,6 +55,14 @@ let IkonotvPieceContainer = React.createClass({
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() {
PieceStore.unlisten(this.onChange);
UserStore.unlisten(this.onChange);