2020-10-08 14:08:32 -04:00
|
|
|
import { queryToObject } from '~/lib/utils/url_utility';
|
|
|
|
import createStore from './store';
|
2020-11-06 01:08:51 -05:00
|
|
|
import { initSidebar } from './sidebar';
|
2020-10-30 14:08:56 -04:00
|
|
|
import initGroupFilter from './group_filter';
|
2020-10-08 14:08:32 -04:00
|
|
|
|
2020-11-16 19:09:16 -05:00
|
|
|
export const initSearchApp = () => {
|
|
|
|
// Similar to url_utility.decodeUrlParameter
|
|
|
|
// Our query treats + as %20. This replaces the query + symbols with %20.
|
|
|
|
const sanitizedSearch = window.location.search.replace(/\+/g, '%20');
|
|
|
|
const store = createStore({ query: queryToObject(sanitizedSearch) });
|
2020-11-10 19:08:58 -05:00
|
|
|
|
2020-11-16 19:09:16 -05:00
|
|
|
initSidebar(store);
|
2020-10-30 14:08:56 -04:00
|
|
|
initGroupFilter(store);
|
2020-10-08 14:08:32 -04:00
|
|
|
};
|