mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 19:31:54 +03:00
Merge pull request #1952 from ecency/nt/accessing-own-profile
NT - Own Profile Fix
This commit is contained in:
commit
149c4252a9
@ -242,14 +242,14 @@ class ProfileView extends PureComponent {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { handleOnBackPress, isOwnProfile, quickProfile } = this.props;
|
||||
const { handleOnBackPress, isOwnProfile, quickProfile, reverseHeader } = this.props;
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Header
|
||||
key={quickProfile && quickProfile.name}
|
||||
selectedUser={quickProfile}
|
||||
isReverse={!isOwnProfile}
|
||||
isReverse={reverseHeader}
|
||||
handleOnBackPress={handleOnBackPress}
|
||||
/>
|
||||
<View style={styles.container}>
|
||||
|
@ -33,6 +33,13 @@ class ProfileContainer extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
//check if is signed in user profile
|
||||
const username = props.navigation.getParam('username');
|
||||
const {
|
||||
currentAccount: { name: currentAccountUsername },
|
||||
} = props;
|
||||
const isOwnProfile = !username || currentAccountUsername === username;
|
||||
|
||||
this.state = {
|
||||
comments: [],
|
||||
follows: {},
|
||||
@ -42,12 +49,13 @@ class ProfileContainer extends Component {
|
||||
isMuted: false,
|
||||
isProfileLoading: false,
|
||||
isReady: false,
|
||||
isOwnProfile: !has(props, 'navigation.state.params.username'),
|
||||
isOwnProfile,
|
||||
user: null,
|
||||
quickProfile: {
|
||||
reputation: get(props, 'navigation.state.params.reputation', ''),
|
||||
name: get(props, 'navigation.state.params.username', ''),
|
||||
},
|
||||
reverseHeader: !!username,
|
||||
};
|
||||
}
|
||||
|
||||
@ -427,6 +435,7 @@ class ProfileContainer extends Component {
|
||||
quickProfile,
|
||||
user,
|
||||
username,
|
||||
reverseHeader,
|
||||
} = this.state;
|
||||
const { currency, isDarkTheme, isLoggedIn, navigation, children, isHideImage } = this.props;
|
||||
const activePage = get(navigation.state.params, 'state', 0);
|
||||
@ -476,6 +485,7 @@ class ProfileContainer extends Component {
|
||||
quickProfile,
|
||||
selectedUser: user,
|
||||
username,
|
||||
reverseHeader,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ const ProfileScreen = () => (
|
||||
setEstimatedWalletValue,
|
||||
username,
|
||||
votingPower,
|
||||
reverseHeader,
|
||||
}) => (
|
||||
<Profile
|
||||
about={about}
|
||||
@ -74,6 +75,7 @@ const ProfileScreen = () => (
|
||||
username={username}
|
||||
votingPower={votingPower}
|
||||
isHideImage={isHideImage}
|
||||
reverseHeader={reverseHeader}
|
||||
/>
|
||||
)}
|
||||
</ProfileContainer>
|
||||
|
Loading…
Reference in New Issue
Block a user