move plant deselect to after navigation

This commit is contained in:
gabrielburnworth 2018-06-05 21:10:47 -07:00
parent 122722e3c1
commit f34fb03b41
2 changed files with 5 additions and 4 deletions

View file

@ -10,6 +10,7 @@ import { AxisInputBox } from "../../controls/axis_input_box";
import { isNumber } from "lodash";
import { Actions } from "../../constants";
import { validBotLocationData } from "../../util/util";
import { unselectPlant } from "../actions";
export function mapStateToProps(props: Everything) {
return {
@ -90,6 +91,10 @@ export class MoveToForm extends React.Component<MoveToFormProps, MoveToFormState
@connect(mapStateToProps)
export class MoveTo extends React.Component<MoveToProps, {}> {
componentDidMount() {
unselectPlant(this.props.dispatch)();
}
componentWillUnmount() {
this.props.dispatch({
type: Actions.CHOOSE_LOCATION,

View file

@ -11,10 +11,6 @@ import { unselectPlant } from "../actions";
@connect(mapStateToProps)
export class PlantInfo extends PlantInfoBase {
componentWillUnmount() {
unselectPlant(this.props.dispatch)();
}
default = (plant_info: TaggedPlantPointer) => {
const info = formatPlantInfo(plant_info);
const { name, id } = info;