mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
Add check for undefined formData
This commit is contained in:
parent
4074b986c2
commit
4a610296e2
1 changed files with 5 additions and 1 deletions
|
@ -75,7 +75,11 @@ var Search = injectIntl(React.createClass({
|
|||
}.bind(this));
|
||||
},
|
||||
onSearchSubmit: function (formData) {
|
||||
window.location.href = '/search/projects?q=' + formData.q;
|
||||
if (!formData.q){
|
||||
window.location.href = '/search/projects?q=' + this.props.searchTerm;
|
||||
} else {
|
||||
window.location.href = '/search/projects?q=' + formData.q;
|
||||
}
|
||||
},
|
||||
getTab: function (type) {
|
||||
var term = this.props.searchTerm.split(' ').join('+');
|
||||
|
|
Loading…
Reference in a new issue