sforkowany z mirror/soapbox
Merge branch 'blockers_visible_support' into 'develop'
Support the blockers_visible option when it's available See merge request soapbox-pub/soapbox-fe!991profile-avatar-switcher
commit
c13b36fed3
|
@ -17,6 +17,7 @@ import LoadingIndicator from 'soapbox/components/loading_indicator';
|
|||
import MissingIndicator from 'soapbox/components/missing_indicator';
|
||||
import SubNavigation from 'soapbox/components/sub_navigation';
|
||||
import { getAccountGallery, findAccountByUsername } from 'soapbox/selectors';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
|
||||
import { expandAccountMediaTimeline } from '../../actions/timelines';
|
||||
|
||||
|
@ -26,6 +27,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => {
|
|||
const username = params.username || '';
|
||||
const me = state.get('me');
|
||||
const accountFetchError = ((state.getIn(['accounts', -1, 'username']) || '').toLowerCase() === username.toLowerCase());
|
||||
const features = getFeatures(state.get('instance'));
|
||||
|
||||
let accountId = -1;
|
||||
let accountUsername = username;
|
||||
|
@ -38,7 +40,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => {
|
|||
}
|
||||
|
||||
const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false);
|
||||
const unavailable = (me === accountId) ? false : isBlocked;
|
||||
const unavailable = (me === accountId) ? false : (isBlocked && !features.blockersVisible);
|
||||
|
||||
return {
|
||||
accountId,
|
||||
|
|
|
@ -15,6 +15,7 @@ import Icon from 'soapbox/components/icon';
|
|||
import MissingIndicator from 'soapbox/components/missing_indicator';
|
||||
import SubNavigation from 'soapbox/components/sub_navigation';
|
||||
import { makeGetStatusIds, findAccountByUsername } from 'soapbox/selectors';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
|
||||
import { fetchAccount, fetchAccountByUsername } from '../../actions/accounts';
|
||||
import { fetchAccountIdentityProofs } from '../../actions/identity_proofs';
|
||||
|
@ -31,6 +32,7 @@ const makeMapStateToProps = () => {
|
|||
const me = state.get('me');
|
||||
const accountFetchError = ((state.getIn(['accounts', -1, 'username']) || '').toLowerCase() === username.toLowerCase());
|
||||
const soapboxConfig = getSoapboxConfig(state);
|
||||
const features = getFeatures(state.get('instance'));
|
||||
|
||||
let accountId = -1;
|
||||
let accountUsername = username;
|
||||
|
@ -47,7 +49,7 @@ const makeMapStateToProps = () => {
|
|||
const path = withReplies ? `${accountId}:with_replies` : accountId;
|
||||
|
||||
const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false);
|
||||
const unavailable = (me === accountId) ? false : isBlocked;
|
||||
const unavailable = (me === accountId) ? false : (isBlocked && !features.blockersVisible);
|
||||
const showPins = getSettings(state).getIn(['account_timeline', 'shows', 'pinned']) && !withReplies;
|
||||
|
||||
return {
|
||||
|
|
|
@ -8,6 +8,7 @@ import { connect } from 'react-redux';
|
|||
|
||||
import MissingIndicator from 'soapbox/components/missing_indicator';
|
||||
import { findAccountByUsername } from 'soapbox/selectors';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
|
||||
import { fetchAccount, fetchAccountByUsername } from '../../actions/accounts';
|
||||
import { fetchFavouritedStatuses, expandFavouritedStatuses, fetchAccountFavouritedStatuses, expandAccountFavouritedStatuses } from '../../actions/favourites';
|
||||
|
@ -26,6 +27,8 @@ const mapStateToProps = (state, { params }) => {
|
|||
|
||||
const isMyAccount = (username.toLowerCase() === meUsername.toLowerCase());
|
||||
|
||||
const features = getFeatures(state.get('instance'));
|
||||
|
||||
if (isMyAccount) {
|
||||
return {
|
||||
isMyAccount,
|
||||
|
@ -46,7 +49,7 @@ const mapStateToProps = (state, { params }) => {
|
|||
}
|
||||
|
||||
const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false);
|
||||
const unavailable = (me === accountId) ? false : isBlocked;
|
||||
const unavailable = (me === accountId) ? false : (isBlocked && !features.blockersVisible);
|
||||
|
||||
return {
|
||||
isMyAccount,
|
||||
|
|
|
@ -9,6 +9,7 @@ import { connect } from 'react-redux';
|
|||
import MissingIndicator from 'soapbox/components/missing_indicator';
|
||||
import { findAccountByUsername } from 'soapbox/selectors';
|
||||
import { getFollowDifference } from 'soapbox/utils/accounts';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
|
||||
import {
|
||||
fetchAccount,
|
||||
|
@ -29,6 +30,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => {
|
|||
const username = params.username || '';
|
||||
const me = state.get('me');
|
||||
const accountFetchError = ((state.getIn(['accounts', -1, 'username']) || '').toLowerCase() === username.toLowerCase());
|
||||
const features = getFeatures(state.get('instance'));
|
||||
|
||||
let accountId = -1;
|
||||
if (accountFetchError) {
|
||||
|
@ -40,7 +42,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => {
|
|||
|
||||
const diffCount = getFollowDifference(state, accountId, 'followers');
|
||||
const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false);
|
||||
const unavailable = (me === accountId) ? false : isBlocked;
|
||||
const unavailable = (me === accountId) ? false : (isBlocked && !features.blockersVisible);
|
||||
|
||||
return {
|
||||
accountId,
|
||||
|
|
|
@ -9,6 +9,7 @@ import { connect } from 'react-redux';
|
|||
import MissingIndicator from 'soapbox/components/missing_indicator';
|
||||
import { findAccountByUsername } from 'soapbox/selectors';
|
||||
import { getFollowDifference } from 'soapbox/utils/accounts';
|
||||
import { getFeatures } from 'soapbox/utils/features';
|
||||
|
||||
import {
|
||||
fetchAccount,
|
||||
|
@ -29,6 +30,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => {
|
|||
const username = params.username || '';
|
||||
const me = state.get('me');
|
||||
const accountFetchError = ((state.getIn(['accounts', -1, 'username']) || '').toLowerCase() === username.toLowerCase());
|
||||
const features = getFeatures(state.get('instance'));
|
||||
|
||||
let accountId = -1;
|
||||
if (accountFetchError) {
|
||||
|
@ -40,7 +42,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => {
|
|||
|
||||
const diffCount = getFollowDifference(state, accountId, 'following');
|
||||
const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false);
|
||||
const unavailable = (me === accountId) ? false : isBlocked;
|
||||
const unavailable = (me === accountId) ? false : (isBlocked && !features.blockersVisible);
|
||||
|
||||
return {
|
||||
accountId,
|
||||
|
|
|
@ -32,6 +32,7 @@ export const getFeatures = createSelector([
|
|||
v.software === MASTODON && gte(v.compatVersion, '3.4.0'),
|
||||
features.includes('v2_suggestions'),
|
||||
]),
|
||||
blockersVisible: features.includes('blockers_visible'),
|
||||
trends: v.software === MASTODON && gte(v.compatVersion, '3.0.0'),
|
||||
mediaV2: any([
|
||||
v.software === MASTODON && gte(v.compatVersion, '3.1.3'),
|
||||
|
|
Ładowanie…
Reference in New Issue