query trimming now works properly on searchquerycommitted

Summary: query trimming was broken due to searchquerycommited passing an object instead of a string

Test Plan: tested manually. Unit tests

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1763
This commit is contained in:
EthanBlackburn 2015-07-17 16:18:24 -07:00
parent 7ad046a8d3
commit ec313e54cf

View file

@ -32,6 +32,8 @@ class FocusedCategoryStore extends NylasStore
@_setCategory(category) @_setCategory(category)
_onSearchQueryCommitted: (query="") -> _onSearchQueryCommitted: (query="") ->
if typeof(query) != "string"
query = query[0].all
if query.trim().length > 0 and @_category if query.trim().length > 0 and @_category
@_categoryBeforeSearch = @_category @_categoryBeforeSearch = @_category
@_setCategory(null) @_setCategory(null)