diff options
Diffstat (limited to 'ui/app/components')
| -rw-r--r-- | ui/app/components/main_panel/email_section.js | 39 | ||||
| -rw-r--r-- | ui/app/components/main_panel/index.js | 14 | 
2 files changed, 24 insertions, 29 deletions
diff --git a/ui/app/components/main_panel/email_section.js b/ui/app/components/main_panel/email_section.js index c86188eb..e48b8e27 100644 --- a/ui/app/components/main_panel/email_section.js +++ b/ui/app/components/main_panel/email_section.js @@ -74,19 +74,15 @@ export default class EmailSection extends React.Component {    }    componentWillMount() { -    //let events = [].concat(GENERAL_NOTICES, ACCOUNT_NOTICES, STATUSES, STATUS_ERRORS) -    //for (let event of events) { -    //  bitmask.events.register(event, this.logEvent) -    //} +    let events = [].concat(GENERAL_NOTICES, ACCOUNT_NOTICES, STATUSES, STATUS_ERRORS) +    for (let event of events) { +      bitmask.events.register(event, this.logEvent) +    }      bitmask.mail.status().then(status => { -      // either 'running' or 'disabled' -      let newstatus = 'error' -      if (status['mail'] == 'running') { -        newstatus = 'on' -      } else if (status['mail'] == 'disabled') { -        newstatus = 'disabled' -      } -      this.setState({status: newstatus}) +      this.setState({ +        status: status.status, +        error: status.error +      })      })    } @@ -107,13 +103,13 @@ export default class EmailSection extends React.Component {    }    render () { -    //let message = null -    //if (this.state.error) { -    //  // style may be: success, warning, danger, info -    //  message = ( -    //    <Alert bsStyle="danger">{this.state.error}</Alert> -    //  ) -    //} +    let message = null +    if (this.state.error) { +      // style may be: success, warning, danger, info +      message = ( +        <Alert bsStyle="danger">{this.state.error}</Alert> +      ) +    }      let button = null      let body = null      let header = <h1>Mail</h1> @@ -124,12 +120,13 @@ export default class EmailSection extends React.Component {        header = <h1>Mail Disabled</h1>      }      if (this.state.expanded) { -      body = ( +      body = (<div> +        {message}          <ButtonToolbar>            <IMAPButton account={this.props.account} />            <Button onClick={this.openKeys}>Addressbook</Button>          </ButtonToolbar> -      ) +      </div>)      }      return (        <SectionLayout icon="envelope" status={this.state.status} diff --git a/ui/app/components/main_panel/index.js b/ui/app/components/main_panel/index.js index 05a1e903..cac58cbb 100644 --- a/ui/app/components/main_panel/index.js +++ b/ui/app/components/main_panel/index.js @@ -76,14 +76,12 @@ export default class MainPanel extends React.Component {        }      } -    if (false) { -      sidePanel = ( -        <AccountList account={this.state.account} -          accounts={this.state.accounts} -          onSelect={this.activateAccount} -          onRemove={this.removeAccount}/> -      ) -    } +    sidePanel = ( +      <AccountList account={this.state.account} +        accounts={this.state.accounts} +        onSelect={this.activateAccount} +        onRemove={this.removeAccount}/> +    )      return (        <div className="main-panel">  | 
