进入自己的主页右上角显示设置

This commit is contained in:
xuwenyang 2020-01-04 16:02:01 +08:00
parent 2e8c40d119
commit 55a1003c90

View file

@ -132,21 +132,34 @@ export default class UserPage extends Component {
componentDidMount() {
if(this.userId) {
Api.getRelation(this.userId)
.then(re => {
this.followed = re;
if(this.followed) {
Api.getSelfInfoByStore()
.then(user => {
if(user && user.id == this.userId) {
Navigation.mergeOptions(this.props.componentId, {
topBar: {
rightButtons: [{
id: 'navButtonFollowSelected',
icon: Icon.navButtonFollowSelected
id: 'setting',
icon: Icon.navButtonSetting
}]
}
});
} else {
Api.getRelation(this.userId)
.then(re => {
this.followed = re;
if(this.followed) {
Navigation.mergeOptions(this.props.componentId, {
topBar: {
rightButtons: [{
id: 'navButtonFollowSelected',
icon: Icon.navButtonFollowSelected
}]
}
});
}
});
}
});
}
this.notebookListener = DeviceEventEmitter.addListener(Event.updateNotebooks, (param) => {