From e6501d5112e73d68876a03a348f1d8486a79fc34 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 12 Apr 2021 12:37:14 +0200 Subject: [Glitch] Add cold-start follow recommendations Port front-end changes from f7117646afddb2676e9275d8efe90c3a20c59021 to glitch-soc Signed-off-by: Claire --- .../glitch/features/compose/components/search_results.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app/javascript/flavours/glitch/features/compose') diff --git a/app/javascript/flavours/glitch/features/compose/components/search_results.js b/app/javascript/flavours/glitch/features/compose/components/search_results.js index bbf997c1f..f5ec65877 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search_results.js +++ b/app/javascript/flavours/glitch/features/compose/components/search_results.js @@ -51,13 +51,13 @@ class SearchResults extends ImmutablePureComponent { - {suggestions && suggestions.map(accountId => ( + {suggestions && suggestions.map(suggestion => ( ))} -- cgit From b1d4f21db0d413c887978ff69aa46b3bc8ea1f3d Mon Sep 17 00:00:00 2001 From: Takeshi Umeda Date: Fri, 16 Apr 2021 17:06:42 +0900 Subject: [Glitch] Fix not to show follow button in global suggestion Port baed52c2a7d8f91bae3c69150005fc528387785c to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/components/account.js | 6 ++++-- .../flavours/glitch/features/compose/components/search_results.js | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'app/javascript/flavours/glitch/features/compose') diff --git a/app/javascript/flavours/glitch/components/account.js b/app/javascript/flavours/glitch/components/account.js index 23399c630..20313535b 100644 --- a/app/javascript/flavours/glitch/components/account.js +++ b/app/javascript/flavours/glitch/components/account.js @@ -87,8 +87,10 @@ class Account extends ImmutablePureComponent { let buttons; - if (onActionClick && actionIcon) { - buttons = ; + if (onActionClick) { + if (actionIcon) { + buttons = ; + } } else if (account.get('id') !== me && !small && account.get('relationship', null) !== null) { const following = account.getIn(['relationship', 'following']); const requested = account.getIn(['relationship', 'requested']); diff --git a/app/javascript/flavours/glitch/features/compose/components/search_results.js b/app/javascript/flavours/glitch/features/compose/components/search_results.js index f5ec65877..c7e225507 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search_results.js +++ b/app/javascript/flavours/glitch/features/compose/components/search_results.js @@ -55,9 +55,9 @@ class SearchResults extends ImmutablePureComponent { ))} -- cgit From 5fa4138bd891a490de238f34755ada53fff987d7 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 6 May 2021 02:11:43 +0200 Subject: [Glitch] Fix "You might be interested in" flashing while searching in web UI Port 0a3fa034fc66246dbf9dfb4627a983e0903042d4 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/actions/search.js | 1 + .../flavours/glitch/features/compose/components/search_results.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/features/compose') diff --git a/app/javascript/flavours/glitch/actions/search.js b/app/javascript/flavours/glitch/actions/search.js index a025f352a..b4aee4525 100644 --- a/app/javascript/flavours/glitch/actions/search.js +++ b/app/javascript/flavours/glitch/actions/search.js @@ -32,6 +32,7 @@ export function submitSearch() { const value = getState().getIn(['search', 'value']); if (value.length === 0) { + dispatch(fetchSearchSuccess({ accounts: [], statuses: [], hashtags: [] }, '')); return; } diff --git a/app/javascript/flavours/glitch/features/compose/components/search_results.js b/app/javascript/flavours/glitch/features/compose/components/search_results.js index c7e225507..a0f86a06a 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search_results.js +++ b/app/javascript/flavours/glitch/features/compose/components/search_results.js @@ -33,6 +33,12 @@ class SearchResults extends ImmutablePureComponent { } } + componentDidUpdate () { + if (this.props.searchTerm === '') { + this.props.fetchSuggestions(); + } + } + handleLoadMoreAccounts = () => this.props.expandSearch('accounts'); handleLoadMoreStatuses = () => this.props.expandSearch('statuses'); @@ -42,7 +48,7 @@ class SearchResults extends ImmutablePureComponent { render () { const { intl, results, suggestions, dismissSuggestion, searchTerm } = this.props; - if (results.isEmpty() && !suggestions.isEmpty()) { + if (searchTerm === '' && !suggestions.isEmpty()) { return (
-- cgit