1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 21:52:08 +02:00

fix app crashing bug when transferring an edition

This commit is contained in:
Tim Daubenschütz 2015-07-27 14:59:49 +02:00
parent 861f633476
commit a05698efc1

View File

@ -68,6 +68,15 @@ let Edition = React.createClass({
},
componentWillUnmount() {
// Flushing the coa state is essential to not displaying the same
// data to the user while he's on another edition
//
// BUGFIX: Previously we had this line in the componentWillUnmount of
// CoaDetails, but since we're reloading the edition after performing an ACL action
// on it, this resulted in multiple events occupying the dispatcher, which eventually
// resulted in crashing the app.
CoaActions.flushCoa();
UserStore.unlisten(this.onChange);
PieceListStore.unlisten(this.onChange);
},
@ -400,9 +409,6 @@ let CoaDetails = React.createClass({
},
componentWillUnmount() {
// Flushing the coa state is essential to not displaying the same
// data to the user while he's on another edition
CoaActions.flushCoa();
CoaStore.unlisten(this.onChange);
},