mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-27 20:51:36 +01:00
[Glitch] Fix "You might be interested in" flashing while searching in web UI
Port 0a3fa034fc
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
b571bc3278
commit
5fa4138bd8
2 changed files with 8 additions and 1 deletions
|
@ -32,6 +32,7 @@ export function submitSearch() {
|
||||||
const value = getState().getIn(['search', 'value']);
|
const value = getState().getIn(['search', 'value']);
|
||||||
|
|
||||||
if (value.length === 0) {
|
if (value.length === 0) {
|
||||||
|
dispatch(fetchSearchSuccess({ accounts: [], statuses: [], hashtags: [] }, ''));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,12 @@ class SearchResults extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidUpdate () {
|
||||||
|
if (this.props.searchTerm === '') {
|
||||||
|
this.props.fetchSuggestions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
handleLoadMoreAccounts = () => this.props.expandSearch('accounts');
|
handleLoadMoreAccounts = () => this.props.expandSearch('accounts');
|
||||||
|
|
||||||
handleLoadMoreStatuses = () => this.props.expandSearch('statuses');
|
handleLoadMoreStatuses = () => this.props.expandSearch('statuses');
|
||||||
|
@ -42,7 +48,7 @@ class SearchResults extends ImmutablePureComponent {
|
||||||
render () {
|
render () {
|
||||||
const { intl, results, suggestions, dismissSuggestion, searchTerm } = this.props;
|
const { intl, results, suggestions, dismissSuggestion, searchTerm } = this.props;
|
||||||
|
|
||||||
if (results.isEmpty() && !suggestions.isEmpty()) {
|
if (searchTerm === '' && !suggestions.isEmpty()) {
|
||||||
return (
|
return (
|
||||||
<div className='drawer--results'>
|
<div className='drawer--results'>
|
||||||
<div className='trends'>
|
<div className='trends'>
|
||||||
|
|
Loading…
Reference in a new issue