Skip to content

Commit

Permalink
Fix circles loading in share page and followers search
Browse files Browse the repository at this point in the history
  • Loading branch information
noellabo committed Sep 5, 2020
1 parent 10b821f commit d7d96ed
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/javascript/mastodon/actions/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function submitCompose(routerHistory) {
'Idempotency-Key': getState().getIn(['compose', 'idempotencyKey']),
},
}).then(function (response) {
if (response.data.visibility === 'direct' && getState().getIn(['conversations', 'mounted']) <= 0 && routerHistory) {
if (response.data.visibility === 'direct' && !response.data.limited && getState().getIn(['conversations', 'mounted']) <= 0 && routerHistory) {
routerHistory.push('/timelines/direct');
} else if (routerHistory && routerHistory.location.pathname === '/statuses/new' && window.history.state) {
routerHistory.goBack();
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/mastodon/containers/compose_container.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { getLocale } from '../locales';
import Compose from '../features/standalone/compose';
import initialState from '../initial_state';
import { fetchCustomEmojis } from '../actions/custom_emojis';
import { fetchCircles } from '../actions/circles';

const { localeData, messages } = getLocale();
addLocaleData(localeData);
Expand All @@ -19,6 +20,7 @@ if (initialState) {
}

store.dispatch(fetchCustomEmojis());
store.dispatch(fetchCircles());

export default class TimelineContainer extends React.PureComponent {

Expand Down
2 changes: 0 additions & 2 deletions app/javascript/mastodon/features/circles/components/circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import Icon from '../../../components/icon';
import IconButton from '../../../components/icon_button';
import { openModal } from '../../../actions/modal';
import { deleteCircle } from '../../../actions/circles';
import { defaultMediaVisibility } from '../../../components/status';

const messages = defineMessages({
deleteTitle: { id: 'confirmations.delete_circle.title', defaultMessage: 'Delete' },
Expand Down
1 change: 1 addition & 0 deletions app/javascript/styles/mastodon/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6343,6 +6343,7 @@ noscript {
background: lighten($ui-base-color, 8%);
color: $primary-text-color;
padding: 15px;
margin: 0;
font-size: 16px;
text-align: left;
text-decoration: none;
Expand Down
5 changes: 5 additions & 0 deletions app/javascript/styles/mastodon/rtl.scss
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,9 @@ body.rtl {
left: auto;
right: 0;
}

.circle-link .circle-edit-button,
.circle-link .circle-delete-button {
text-align: right;
}
}
7 changes: 6 additions & 1 deletion app/services/account_search_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ def exact_match
end
end

match = nil if !match.nil? && !account.nil? && options[:following] && !account.following?(match)
@exact_match = nil

unless match.nil? || account.nil?
return if options[:following] && !account.following?(match)
return if options[:followers] && !match.following?(account)
end

@exact_match = match
end
Expand Down

0 comments on commit d7d96ed

Please sign in to comment.