import { connect } from "react-redux";
import EntriesPage from "../components/EntriesPage.js";
import { clearSearchResults } from "../library/messaging.js";
import { searchEntriesForTerm } from "../../shared/library/messaging.js";

export default connect(
    (state, ownProps) => ({}),
    {
        onPrepare: () => () => {
            clearSearchResults();
        },
        onSearchTermChange: searchTerm => () => {
            if (searchTerm.trim().length > 0) {
                searchEntriesForTerm(searchTerm);
            } else {
                clearSearchResults();
            }
        }
    }
)(EntriesPage);

@@ -322,51 +322,8 @@
 =%3E %7B
-%0A            clearSearchResults();%0A        
 %7D,%0A 

Stop clearing search results on popup init