mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-01 10:14:28 +02:00
fixed react warning
This commit is contained in:
parent
57a1905e7d
commit
97723a1150
2 changed files with 9 additions and 4 deletions
|
@ -16,15 +16,19 @@ var LevelToolbarView = React.createClass({
|
|||
getInitialState: function() {
|
||||
return {
|
||||
isHidden: true,
|
||||
isGoalExpanded: false
|
||||
isGoalExpanded: this.props.parent.getIsGoalExpanded()
|
||||
};
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this.setState({
|
||||
isHidden: false
|
||||
isHidden: this.props.parent.getIsGoalExpanded()
|
||||
});
|
||||
this.props.parent.on('goalToggled', function() {
|
||||
if (!this.isMounted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState({
|
||||
isGoalExpanded: this.props.parent.getIsGoalExpanded()
|
||||
});
|
||||
|
@ -57,8 +61,8 @@ var LevelToolbarView = React.createClass({
|
|||
onClick={this.props.onGoalClick}
|
||||
type="button">
|
||||
{this.state.isGoalExpanded ?
|
||||
intl.str('show-goal-button') :
|
||||
intl.str('hide-goal-button')
|
||||
intl.str('hide-goal-button') :
|
||||
intl.str('show-goal-button')
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -10,6 +10,7 @@ var MyError = Backbone.Model.extend({
|
|||
|
||||
getMsg: function() {
|
||||
if (!this.get('msg')) {
|
||||
debugger;
|
||||
console.warn('mye rror without message');
|
||||
}
|
||||
return this.get('msg');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue