From 53f4ca91956f5493f6f20dc439b66fcbf36ea0b0 Mon Sep 17 00:00:00 2001 From: lizg <903504686@qq.com> Date: Fri, 24 Jun 2022 11:19:17 +0800 Subject: [PATCH 1/2] fix: update userinfo --- demo/src/components/header/HeaderOps.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/demo/src/components/header/HeaderOps.js b/demo/src/components/header/HeaderOps.js index aa2335e0..5a1ecb76 100644 --- a/demo/src/components/header/HeaderOps.js +++ b/demo/src/components/header/HeaderOps.js @@ -87,16 +87,19 @@ class HeaderOps extends Component { } } - showUserInfo = async () =>{ + componentWillMount = async () => { let info = await this.props.getUserInfo(WebIM.conn.context.userId) this.userInfo = info.data[WebIM.conn.context.userId] this.props.setOwnInfo(this.userInfo) - this.userInfo.userId = WebIM.conn.context.userId + } + + showUserInfo = () => { this.setState({ modal: 'showUserInfo' }) } + handleModalClose(e) { this.setState({ modal: '' }) this.props.setShowGroupRequestModal(false) From 7dadcb7c0033744e4ed6a1f4e3e667641a9e6d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E5=9B=BD?= <903504686@qq.com> Date: Fri, 24 Jun 2022 18:21:34 +0800 Subject: [PATCH 2/2] Update HeaderOps.js --- demo/src/components/header/HeaderOps.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/src/components/header/HeaderOps.js b/demo/src/components/header/HeaderOps.js index 5a1ecb76..665b3cc0 100644 --- a/demo/src/components/header/HeaderOps.js +++ b/demo/src/components/header/HeaderOps.js @@ -87,8 +87,8 @@ class HeaderOps extends Component { } } - componentWillMount = async () => { - let info = await this.props.getUserInfo(WebIM.conn.context.userId) + componentWillMount = () => { + let info = this.props.getUserInfo(WebIM.conn.context.userId) this.userInfo = info.data[WebIM.conn.context.userId] this.props.setOwnInfo(this.userInfo) }