Skip to content

Commit

Permalink
Removed default modal from CollectComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpigeon committed Sep 24, 2018
1 parent 9a0cf46 commit b3ceb64
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions app/components/CollectComponent/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import React, { Component } from 'react';
import { Modal, Button, Segment } from 'semantic-ui-react';
import {
EXPERIMENTS,
DEVICES,
Expand Down Expand Up @@ -60,6 +59,12 @@ export default class Collect extends Component<Props, State> {
this.handleRunComponentClose = this.handleRunComponentClose.bind(this);
}

componentDidMount() {
if (this.props.connectionStatus !== CONNECTION_STATUS.CONNECTED) {
this.handleStartConnect();
}
}

componentDidUpdate = (prevProps: Props, prevState: State) => {
if (
this.props.connectionStatus === CONNECTION_STATUS.CONNECTED &&
Expand Down Expand Up @@ -99,19 +104,6 @@ export default class Collect extends Component<Props, State> {
}
return (
<div>
<Modal
basic
centered
open={this.props.connectionStatus !== CONNECTION_STATUS.CONNECTED}
dimmer="inverted"
size="small"
>
<Segment basic textAlign="center">
<Button primary onClick={this.handleStartConnect}>
Connect Device
</Button>
</Segment>
</Modal>
<ConnectModal
open={this.state.isConnectModalOpen}
onClose={this.handleConnectModalClose}
Expand Down

0 comments on commit b3ceb64

Please sign in to comment.