Skip to content

Commit

Permalink
feat(wrapWithHits): enable async init (#2635)
Browse files Browse the repository at this point in the history
  • Loading branch information
samouss authored and bobylito committed Dec 22, 2017
1 parent 505552a commit 08a8747
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dev/app/utils/wrap-with-hits.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ export const wrapWithHits = (
})
);

initWidget(window.document.getElementById('widget-display'));
if (initWidget.length === 1) {
initWidget(window.document.getElementById('widget-display'));

window.search.start();
return window.search.start();
}

return initWidget(window.document.getElementById('widget-display'), () => {
window.search.start();
});
};

export const wrapWithHitsAndJquery = fn =>
Expand Down

0 comments on commit 08a8747

Please sign in to comment.