mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -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));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
onSearchSubmit: function (formData) {
|
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) {
|
getTab: function (type) {
|
||||||
var term = this.props.searchTerm.split(' ').join('+');
|
var term = this.props.searchTerm.split(' ').join('+');
|
||||||
|
|
Loading…
Reference in a new issue