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