Skip to content

Commit

Permalink
Merge commit 'd9503a1965a16328b62ea7bf0bb54e87cbe30d29' into glitch-s…
Browse files Browse the repository at this point in the history
…oc/merge-upstream
  • Loading branch information
ClearlyClaire committed Oct 24, 2023
2 parents 79c154f + d9503a1 commit e6c3d3c
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
14 changes: 12 additions & 2 deletions app/javascript/mastodon/features/explore/links.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import { PureComponent } from 'react';

import { FormattedMessage } from 'react-intl';

import { withRouter } from 'react-router-dom';

import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';

import { fetchTrendingLinks } from 'mastodon/actions/trends';
import { DismissableBanner } from 'mastodon/components/dismissable_banner';
import { LoadingIndicator } from 'mastodon/components/loading_indicator';
import { WithRouterPropTypes } from 'mastodon/utils/react_router';

import Story from './components/story';

Expand All @@ -23,10 +26,17 @@ class Links extends PureComponent {
links: ImmutablePropTypes.list,
isLoading: PropTypes.bool,
dispatch: PropTypes.func.isRequired,
...WithRouterPropTypes,
};

componentDidMount () {
const { dispatch } = this.props;
const { dispatch, links, history } = this.props;

// If we're navigating back to the screen, do not trigger a reload
if (history.action === 'POP' && links.size > 0) {
return;
}

dispatch(fetchTrendingLinks());
}

Expand Down Expand Up @@ -77,4 +87,4 @@ class Links extends PureComponent {

}

export default connect(mapStateToProps)(Links);
export default connect(mapStateToProps)(withRouter(Links));
15 changes: 13 additions & 2 deletions app/javascript/mastodon/features/explore/statuses.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ import { PureComponent } from 'react';

import { FormattedMessage } from 'react-intl';

import { withRouter } from 'react-router-dom';

import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';

import { debounce } from 'lodash';


import { fetchTrendingStatuses, expandTrendingStatuses } from 'mastodon/actions/trends';
import { DismissableBanner } from 'mastodon/components/dismissable_banner';
import StatusList from 'mastodon/components/status_list';
import { getStatusList } from 'mastodon/selectors';
import { WithRouterPropTypes } from 'mastodon/utils/react_router';

const mapStateToProps = state => ({
statusIds: getStatusList(state, 'trending'),
Expand All @@ -27,10 +31,17 @@ class Statuses extends PureComponent {
hasMore: PropTypes.bool,
multiColumn: PropTypes.bool,
dispatch: PropTypes.func.isRequired,
...WithRouterPropTypes,
};

componentDidMount () {
const { dispatch } = this.props;
const { dispatch, statusIds, history } = this.props;

// If we're navigating back to the screen, do not trigger a reload
if (history.action === 'POP' && statusIds.size > 0) {
return;
}

dispatch(fetchTrendingStatuses());
}

Expand Down Expand Up @@ -64,4 +75,4 @@ class Statuses extends PureComponent {

}

export default connect(mapStateToProps)(Statuses);
export default connect(mapStateToProps)(withRouter(Statuses));
14 changes: 12 additions & 2 deletions app/javascript/mastodon/features/explore/suggestions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import { PureComponent } from 'react';

import { FormattedMessage } from 'react-intl';

import { withRouter } from 'react-router-dom';

import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';

import { fetchSuggestions } from 'mastodon/actions/suggestions';
import { LoadingIndicator } from 'mastodon/components/loading_indicator';
import AccountCard from 'mastodon/features/directory/components/account_card';
import { WithRouterPropTypes } from 'mastodon/utils/react_router';

const mapStateToProps = state => ({
suggestions: state.getIn(['suggestions', 'items']),
Expand All @@ -21,10 +24,17 @@ class Suggestions extends PureComponent {
isLoading: PropTypes.bool,
suggestions: ImmutablePropTypes.list,
dispatch: PropTypes.func.isRequired,
...WithRouterPropTypes,
};

componentDidMount () {
const { dispatch } = this.props;
const { dispatch, suggestions, history } = this.props;

// If we're navigating back to the screen, do not trigger a reload
if (history.action === 'POP' && suggestions.size > 0) {
return;
}

dispatch(fetchSuggestions(true));
}

Expand Down Expand Up @@ -52,4 +62,4 @@ class Suggestions extends PureComponent {

}

export default connect(mapStateToProps)(Suggestions);
export default connect(mapStateToProps)(withRouter(Suggestions));
14 changes: 12 additions & 2 deletions app/javascript/mastodon/features/explore/tags.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import { PureComponent } from 'react';

import { FormattedMessage } from 'react-intl';

import { withRouter } from 'react-router-dom';

import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';

import { fetchTrendingHashtags } from 'mastodon/actions/trends';
import { DismissableBanner } from 'mastodon/components/dismissable_banner';
import { ImmutableHashtag as Hashtag } from 'mastodon/components/hashtag';
import { LoadingIndicator } from 'mastodon/components/loading_indicator';
import { WithRouterPropTypes } from 'mastodon/utils/react_router';

const mapStateToProps = state => ({
hashtags: state.getIn(['trends', 'tags', 'items']),
Expand All @@ -22,10 +25,17 @@ class Tags extends PureComponent {
hashtags: ImmutablePropTypes.list,
isLoading: PropTypes.bool,
dispatch: PropTypes.func.isRequired,
...WithRouterPropTypes,
};

componentDidMount () {
const { dispatch } = this.props;
const { dispatch, history, hashtags } = this.props;

// If we're navigating back to the screen, do not trigger a reload
if (history.action === 'POP' && hashtags.size > 0) {
return;
}

dispatch(fetchTrendingHashtags());
}

Expand Down Expand Up @@ -63,4 +73,4 @@ class Tags extends PureComponent {

}

export default connect(mapStateToProps)(Tags);
export default connect(mapStateToProps)(withRouter(Tags));
2 changes: 2 additions & 0 deletions lib/tasks/mastodon.rake
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ namespace :mastodon do
rescue => e
prompt.error 'Redis connection could not be established with this configuration, try again.'
prompt.error e.message

unless prompt.yes?('Try again?')
return prompt.warn 'Nothing saved. Bye!' unless prompt.yes?('Continue anyway?')

Expand Down Expand Up @@ -432,6 +433,7 @@ namespace :mastodon do
rescue => e
prompt.error 'E-mail could not be sent with this configuration, try again.'
prompt.error e.message

unless prompt.yes?('Try again?')
return prompt.warn 'Nothing saved. Bye!' unless prompt.yes?('Continue anyway?')

Expand Down

0 comments on commit e6c3d3c

Please sign in to comment.