Commit d9c9d5db authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Improve type-checking

parent 6093ca6b
......@@ -531,16 +531,17 @@ function sortKeys(state) {
/**
* Retrieve state needed to calculate the root thread
*
* @return {ThreadState}
* @type {(rootState: any) => ThreadState}
*/
const threadState = createSelector(
rootState => rootState.annotations.annotations,
rootState => rootState.route.name,
rootState => rootState.selection,
(annotations, routeName, selection) => {
const filters = {};
if (focusModeActive(selection)) {
filters.user = focusModeUserFilter(selection);
const filters = /** @type {Object.<string,string>} */ ({});
const userFilter = focusModeUserFilter(selection);
if (userFilter) {
filters.user = userFilter;
}
const selectionState = {
expanded: expandedMap(selection),
......
......@@ -134,7 +134,7 @@ export function toObject(searchText) {
* Terms that are not associated with a particular facet are stored in the "any"
* facet.
*
* @param {string|null} searchText - Filter query to parse
* @param {string} searchText - Filter query to parse
* @param {FocusFilter} focusFilters - Additional filter terms to mix in
* @return {Object.<string,Facet>}
*/
......
......@@ -47,7 +47,7 @@ function buildRootThread(threadState) {
if (annotationsFiltered) {
const filters = generateFacetedFilter(
selection.filterQuery,
selection.filterQuery || '',
selection.filters
);
options.filterFn = ann => filterAnnotations([ann], filters).length > 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment