diff --git a/src/components/layout.jsx b/src/components/layout.jsx index c7111af56..fadc78bd9 100644 --- a/src/components/layout.jsx +++ b/src/components/layout.jsx @@ -3,10 +3,11 @@ import {IndexLink, Link} from 'react-router' import {connect} from 'react-redux' import classnames from 'classnames' -import {unauthenticated} from '../redux/action-creators' +import {unauthenticated, home} from '../redux/action-creators' import Footer from './footer' import Sidebar from './sidebar' import LoaderContainer from './loader-container' +import {getCurrentRouteName} from '../utils' const InternalLayout = ({authenticated, children}) => (
@@ -16,6 +17,13 @@ const InternalLayout = ({authenticated, children}) => (
) +const logoHandler = (router, cb) => _ => { + if (getCurrentRouteName(router) === 'home') { + return cb() + } + return false +} + class Layout extends React.Component { // Here we have some handling of drag-n-drop, because standard dragenter @@ -122,7 +130,7 @@ class Layout extends React.Component {

- FreeFeed + FreeFeed

@@ -166,12 +174,14 @@ function select(state) { authenticated: state.authenticated, loadingView: state.routeLoadingState, recentGroups: state.recentGroups, + router: state.router, } } function mapDispatchToProps(dispatch){ return { - signOut: ()=>dispatch(unauthenticated()) + signOut: ()=>dispatch(unauthenticated()), + home: ()=> dispatch(home()), } } diff --git a/src/components/user-profile.jsx b/src/components/user-profile.jsx index 9eeb2d0a9..41b1ed904 100644 --- a/src/components/user-profile.jsx +++ b/src/components/user-profile.jsx @@ -26,13 +26,21 @@ export default props => (
{props.type !== 'group' && props.statistics.subscriptions >= 0 ? (
- {pluralForm(props.statistics.subscriptions, 'subscription')} + {props.canISeeSubsList ? ( + {pluralForm(props.statistics.subscriptions, 'subscription')} + ) : ( + pluralForm(props.statistics.subscriptions, 'subscription') + )}
) : false} {' '} {props.statistics.subscribers >= 0 ? (
- {pluralForm(props.statistics.subscribers, 'subscriber')} + {props.canISeeSubsList ? ( + {pluralForm(props.statistics.subscribers, 'subscriber')} + ) : ( + pluralForm(props.statistics.subscribers, 'subscriber') + )}
) : false} {' '} diff --git a/src/components/user.jsx b/src/components/user.jsx index 91435ff39..54b13cc95 100644 --- a/src/components/user.jsx +++ b/src/components/user.jsx @@ -70,6 +70,9 @@ function selectState(state) { hasRequestBeenSent: authenticated && foundUser && ((user.pendingSubscriptionRequests || []).indexOf(foundUser.id) > -1) } + statusExtension.canISeeSubsList = statusExtension.isUserFound && + (foundUser.isPrivate === '0' || statusExtension.subscribed || statusExtension.isItMe) + const viewUser = {...(foundUser), ...statusExtension} const breadcrumbs = {