Skip to content

Commit

Permalink
fix changing the map to no fmus operator error
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubik committed Jan 17, 2025
1 parent dfd4198 commit a17781a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions components/operators-detail/fmus.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,17 @@ class OperatorsDetailFMUs extends React.Component {
const { fmus, fmu, interactions } = this.props;

if (!isEqual(fmus, prevFmus)) {
this.props.setOperatorsDetailFmu(fmus[0].id);
this.getBBOX();
if (fmus.length) {
this.props.setOperatorsDetailFmu(fmus[0].id);
this.getBBOX();
} else {
this.props.setOperatorsDetailFmu(undefined);
this.props.setOperatorsDetailMapLocation({
zoom: 5,
latitude: 0,
longitude: 20,
});
}
}

if (fmu.id !== prevFmu.id) {
Expand Down

0 comments on commit a17781a

Please sign in to comment.