[Glitch] Fix search form re-rendering spuriously in web UI
Port 01ce9df880
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
pull/2583/head
parent
22cfab0ebf
commit
22e419f95e
|
@ -1,3 +1,4 @@
|
|||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import {
|
||||
|
@ -12,10 +13,15 @@ import {
|
|||
|
||||
import Search from '../components/search';
|
||||
|
||||
const getRecentSearches = createSelector(
|
||||
state => state.getIn(['search', 'recent']),
|
||||
recent => recent.reverse(),
|
||||
);
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
value: state.getIn(['search', 'value']),
|
||||
submitted: state.getIn(['search', 'submitted']),
|
||||
recent: state.getIn(['search', 'recent']).reverse(),
|
||||
recent: getRecentSearches(state),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
|
Loading…
Reference in New Issue