@bigbinary/neeto-rules-frontend 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1718,20 +1718,29 @@ var Router = /*#__PURE__*/function (_React$Component) {
1718
1718
  _this._pendingLocation = null;
1719
1719
  if (!props.staticContext) {
1720
1720
  _this.unlisten = props.history.listen(function (location) {
1721
- if (_this._isMounted) {
1722
- _this.setState({
1723
- location: location
1724
- });
1725
- } else {
1726
- _this._pendingLocation = location;
1727
- }
1721
+ _this._pendingLocation = location;
1728
1722
  });
1729
1723
  }
1730
1724
  return _this;
1731
1725
  }
1732
1726
  var _proto = Router.prototype;
1733
1727
  _proto.componentDidMount = function componentDidMount() {
1728
+ var _this2 = this;
1734
1729
  this._isMounted = true;
1730
+ if (this.unlisten) {
1731
+ // Any pre-mount location changes have been captured at
1732
+ // this point, so unregister the listener.
1733
+ this.unlisten();
1734
+ }
1735
+ if (!this.props.staticContext) {
1736
+ this.unlisten = this.props.history.listen(function (location) {
1737
+ if (_this2._isMounted) {
1738
+ _this2.setState({
1739
+ location: location
1740
+ });
1741
+ }
1742
+ });
1743
+ }
1735
1744
  if (this._pendingLocation) {
1736
1745
  this.setState({
1737
1746
  location: this._pendingLocation