mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-04 11:44:27 +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() {
|
getInitialState: function() {
|
||||||
return {
|
return {
|
||||||
isHidden: true,
|
isHidden: true,
|
||||||
isGoalExpanded: false
|
isGoalExpanded: this.props.parent.getIsGoalExpanded()
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
this.setState({
|
this.setState({
|
||||||
isHidden: false
|
isHidden: this.props.parent.getIsGoalExpanded()
|
||||||
});
|
});
|
||||||
this.props.parent.on('goalToggled', function() {
|
this.props.parent.on('goalToggled', function() {
|
||||||
|
if (!this.isMounted()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
isGoalExpanded: this.props.parent.getIsGoalExpanded()
|
isGoalExpanded: this.props.parent.getIsGoalExpanded()
|
||||||
});
|
});
|
||||||
|
@ -57,8 +61,8 @@ var LevelToolbarView = React.createClass({
|
||||||
onClick={this.props.onGoalClick}
|
onClick={this.props.onGoalClick}
|
||||||
type="button">
|
type="button">
|
||||||
{this.state.isGoalExpanded ?
|
{this.state.isGoalExpanded ?
|
||||||
intl.str('show-goal-button') :
|
intl.str('hide-goal-button') :
|
||||||
intl.str('hide-goal-button')
|
intl.str('show-goal-button')
|
||||||
}
|
}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,6 +10,7 @@ var MyError = Backbone.Model.extend({
|
||||||
|
|
||||||
getMsg: function() {
|
getMsg: function() {
|
||||||
if (!this.get('msg')) {
|
if (!this.get('msg')) {
|
||||||
|
debugger;
|
||||||
console.warn('mye rror without message');
|
console.warn('mye rror without message');
|
||||||
}
|
}
|
||||||
return this.get('msg');
|
return this.get('msg');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue