From 55a1003c90003892bc66e424e8e78fca0e8c6de1 Mon Sep 17 00:00:00 2001 From: xuwenyang Date: Sat, 4 Jan 2020 16:02:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E5=85=A5=E8=87=AA=E5=B7=B1=E7=9A=84?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E5=8F=B3=E4=B8=8A=E8=A7=92=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/UserPage.js | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/page/UserPage.js b/src/page/UserPage.js index 8d74bf4..2456fc2 100644 --- a/src/page/UserPage.js +++ b/src/page/UserPage.js @@ -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) => {