diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-05-07 18:21:59 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2021-05-07 18:21:59 +0200 |
commit | 50b430d9a2857edf8ab44e9b94c7bcb14ecd2117 (patch) | |
tree | 4932ca1d8e52f6ce9b8b9fbb304b6bfce4027e54 /app/javascript/mastodon/features | |
parent | a346912030012dc1451249373ff7ef1a61016517 (diff) | |
parent | d8e0c8a89e1f1dd1c4ce1513deaeb3c85c6e4a42 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
- `app/views/statuses/_simple_status.html.haml`: Small markup change in glitch-soc, on a line that has been modified by upstream. Ported upstream changes.
Diffstat (limited to 'app/javascript/mastodon/features')
6 files changed, 30 insertions, 9 deletions
diff --git a/app/javascript/mastodon/features/account/components/header.js b/app/javascript/mastodon/features/account/components/header.js index 8e49486bd..20641121f 100644 --- a/app/javascript/mastodon/features/account/components/header.js +++ b/app/javascript/mastodon/features/account/components/header.js @@ -326,6 +326,8 @@ class Header extends ImmutablePureComponent { {account.get('id') !== me && !suspended && <AccountNoteContainer account={account} />} {account.get('note').length > 0 && account.get('note') !== '<p></p>' && <div className='account__header__content translate' dangerouslySetInnerHTML={content} />} + + <div className='account__header__joined'><FormattedMessage id='account.joined' defaultMessage='Joined {date}' values={{ date: intl.formatDate(account.get('created_at'), { year: 'numeric', month: 'short', day: '2-digit' }) }} /></div> </div> {!suspended && ( diff --git a/app/javascript/mastodon/features/compose/components/search_results.js b/app/javascript/mastodon/features/compose/components/search_results.js index a8b31b677..958a65286 100644 --- a/app/javascript/mastodon/features/compose/components/search_results.js +++ b/app/javascript/mastodon/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 ( <div className='search-results'> <div className='trends'> diff --git a/app/javascript/mastodon/features/follow_recommendations/index.js b/app/javascript/mastodon/features/follow_recommendations/index.js index 1231a27ea..a35ff3e82 100644 --- a/app/javascript/mastodon/features/follow_recommendations/index.js +++ b/app/javascript/mastodon/features/follow_recommendations/index.js @@ -7,6 +7,7 @@ import { FormattedMessage } from 'react-intl'; import { fetchSuggestions } from 'mastodon/actions/suggestions'; import { changeSetting, saveSettings } from 'mastodon/actions/settings'; import { requestBrowserPermission } from 'mastodon/actions/notifications'; +import { markAsPartial } from 'mastodon/actions/timelines'; import Column from 'mastodon/features/ui/components/column'; import Account from './components/account'; import Logo from 'mastodon/components/logo'; @@ -42,6 +43,15 @@ class FollowRecommendations extends ImmutablePureComponent { } } + componentWillUnmount () { + const { dispatch } = this.props; + + // Force the home timeline to be reloaded when the user navigates + // to it; if the user is new, it would've been empty before + + dispatch(markAsPartial('home')); + } + handleDone = () => { const { dispatch } = this.props; const { router } = this.context; @@ -75,10 +85,14 @@ class FollowRecommendations extends ImmutablePureComponent { {!isLoading && ( <React.Fragment> - <div> - {suggestions.map(suggestion => ( + <div className='column-list'> + {suggestions.size > 0 ? suggestions.map(suggestion => ( <Account key={suggestion.get('account')} id={suggestion.get('account')} /> - ))} + )) : ( + <div className='column-list__empty-message'> + <FormattedMessage id='empty_column.follow_recommendations' defaultMessage='Looks like no suggestions could be generated for you. You can try using search to look for people you might know or explore trending hashtags.' /> + </div> + )} </div> <div className='column-actions'> diff --git a/app/javascript/mastodon/features/home_timeline/index.js b/app/javascript/mastodon/features/home_timeline/index.js index 577ff33bb..b85c69af7 100644 --- a/app/javascript/mastodon/features/home_timeline/index.js +++ b/app/javascript/mastodon/features/home_timeline/index.js @@ -73,7 +73,7 @@ class HomeTimeline extends React.PureComponent { } componentDidMount () { - this.props.dispatch(fetchAnnouncements()); + setTimeout(() => this.props.dispatch(fetchAnnouncements()), 700); this._checkIfReloadNeeded(false, this.props.isPartial); } @@ -153,7 +153,7 @@ class HomeTimeline extends React.PureComponent { scrollKey={`home_timeline-${columnId}`} onLoadMore={this.handleLoadMore} timelineId='home' - emptyMessage={<FormattedMessage id='empty_column.home' defaultMessage='Your home timeline is empty! Visit {public} or use search to get started and meet other users.' values={{ public: <Link to='/timelines/public'><FormattedMessage id='empty_column.home.public_timeline' defaultMessage='the public timeline' /></Link> }} />} + emptyMessage={<FormattedMessage id='empty_column.home' defaultMessage='Your home timeline is empty! Follow more people to fill it up. {suggestions}' values={{ suggestions: <Link to='/start'><FormattedMessage id='empty_column.home.suggestions' defaultMessage='See some suggestions' /></Link> }} />} shouldUpdateScroll={shouldUpdateScroll} bindToDocument={!multiColumn} /> diff --git a/app/javascript/mastodon/features/notifications/index.js b/app/javascript/mastodon/features/notifications/index.js index cf8fd7127..1a621eca9 100644 --- a/app/javascript/mastodon/features/notifications/index.js +++ b/app/javascript/mastodon/features/notifications/index.js @@ -178,7 +178,7 @@ class Notifications extends React.PureComponent { render () { const { intl, notifications, shouldUpdateScroll, isLoading, isUnread, columnId, multiColumn, hasMore, numPending, showFilterBar, lastReadId, canMarkAsRead, needsNotificationPermission } = this.props; const pinned = !!columnId; - const emptyMessage = <FormattedMessage id='empty_column.notifications' defaultMessage="You don't have any notifications yet. Interact with others to start the conversation." />; + const emptyMessage = <FormattedMessage id='empty_column.notifications' defaultMessage="You don't have any notifications yet. When other people interact with you, you will see it here." />; let scrollableContent = null; diff --git a/app/javascript/mastodon/features/ui/index.js b/app/javascript/mastodon/features/ui/index.js index 078a69f0f..2b9fe1603 100644 --- a/app/javascript/mastodon/features/ui/index.js +++ b/app/javascript/mastodon/features/ui/index.js @@ -361,10 +361,9 @@ class UI extends React.PureComponent { this.props.dispatch(closeOnboarding()); } - this.props.dispatch(fetchMarkers()); this.props.dispatch(expandHomeTimeline()); this.props.dispatch(expandNotifications()); - + setTimeout(() => this.props.dispatch(fetchMarkers()), 500); setTimeout(() => this.props.dispatch(fetchFilters()), 500); this.hotkeys.__mousetrap__.stopCallback = (e, element) => { |