From 85d1973a6c2d5d04dbf0e3d1b72420251fc4d48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5var=20Aamb=C3=B8=20Fosstveit?= Date: Fri, 25 Oct 2019 15:02:55 +0200 Subject: [PATCH] Fix for state change of picture. --- app/src/components/MeetingDrawer/Chat/ChatInput.js | 4 ++-- app/src/components/MeetingDrawer/Chat/MessageList.js | 4 ++-- .../components/MeetingDrawer/FileSharing/FileList.js | 12 ++++-------- .../MeetingDrawer/ParticipantList/ListMe.js | 2 +- app/src/components/Room.js | 4 ++-- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/app/src/components/MeetingDrawer/Chat/ChatInput.js b/app/src/components/MeetingDrawer/Chat/ChatInput.js index bafaa20..0f0235d 100644 --- a/app/src/components/MeetingDrawer/Chat/ChatInput.js +++ b/app/src/components/MeetingDrawer/Chat/ChatInput.js @@ -123,7 +123,7 @@ ChatInput.propTypes = const mapStateToProps = (state) => ({ displayName : state.settings.displayName, - picture : state.settings.picture + picture : state.me.picture }); export default withRoomContext( @@ -136,7 +136,7 @@ export default withRoomContext( { return ( prev.settings.displayName === next.settings.displayName && - prev.settings.picture === next.settings.picture + prev.me.picture === next.me.picture ); } } diff --git a/app/src/components/MeetingDrawer/Chat/MessageList.js b/app/src/components/MeetingDrawer/Chat/MessageList.js index cdc8809..a5bc154 100644 --- a/app/src/components/MeetingDrawer/Chat/MessageList.js +++ b/app/src/components/MeetingDrawer/Chat/MessageList.js @@ -97,7 +97,7 @@ MessageList.propTypes = const mapStateToProps = (state) => ({ chatmessages : state.chatmessages, - myPicture : state.settings.picture + myPicture : state.me.picture }); export default connect( @@ -109,7 +109,7 @@ export default connect( { return ( prev.chatmessages === next.chatmessages && - prev.settings.picture === next.settings.picture + prev.me.picture === next.me.picture ); } } diff --git a/app/src/components/MeetingDrawer/FileSharing/FileList.js b/app/src/components/MeetingDrawer/FileSharing/FileList.js index 1dcb905..d2142d6 100644 --- a/app/src/components/MeetingDrawer/FileSharing/FileList.js +++ b/app/src/components/MeetingDrawer/FileSharing/FileList.js @@ -45,7 +45,6 @@ class FileList extends React.PureComponent const { files, me, - picture, peers, classes } = this.props; @@ -61,7 +60,7 @@ class FileList extends React.PureComponent if (me.id === file.peerId) { displayName = 'You'; - filePicture = picture; + filePicture = me.picture; } else if (peers[file.peerId]) { @@ -91,7 +90,6 @@ FileList.propTypes = { files : PropTypes.object.isRequired, me : appPropTypes.Me.isRequired, - picture : PropTypes.string, peers : PropTypes.object.isRequired, classes : PropTypes.object.isRequired }; @@ -99,10 +97,9 @@ FileList.propTypes = const mapStateToProps = (state) => { return { - files : state.files, - me : state.me, - picture : state.settings.picture, - peers : state.peers + files : state.files, + me : state.me, + peers : state.peers }; }; @@ -116,7 +113,6 @@ export default connect( return ( prev.files === next.files && prev.me === next.me && - prev.settings.picture === next.settings.picture && prev.peers === next.peers ); } diff --git a/app/src/components/MeetingDrawer/ParticipantList/ListMe.js b/app/src/components/MeetingDrawer/ParticipantList/ListMe.js index 04dcfc6..304cbb9 100644 --- a/app/src/components/MeetingDrawer/ParticipantList/ListMe.js +++ b/app/src/components/MeetingDrawer/ParticipantList/ListMe.js @@ -79,7 +79,7 @@ const ListMe = (props) => classes } = props; - const picture = settings.picture || EmptyAvatar; + const picture = me.picture || EmptyAvatar; return (
  • diff --git a/app/src/components/Room.js b/app/src/components/Room.js index 9590650..c90c9f1 100644 --- a/app/src/components/Room.js +++ b/app/src/components/Room.js @@ -441,7 +441,7 @@ const mapStateToProps = (state) => advancedMode : state.settings.advancedMode, loggedIn : state.me.loggedIn, loginEnabled : state.me.loginEnabled, - myPicture : state.settings.picture, + myPicture : state.me.picture, toolAreaOpen : state.toolarea.toolAreaOpen, unread : state.toolarea.unreadMessages + state.toolarea.unreadFiles @@ -479,7 +479,7 @@ export default withRoomContext(connect( prev.lobbyPeers === next.lobbyPeers && prev.me.loggedIn === next.me.loggedIn && prev.me.loginEnabled === next.me.loginEnabled && - prev.settings.picture === next.settings.picture && + prev.me.picture === next.me.picture && prev.toolarea.toolAreaOpen === next.toolarea.toolAreaOpen && prev.toolarea.unreadMessages === next.toolarea.unreadMessages && prev.toolarea.unreadFiles === next.toolarea.unreadFiles &&