diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2020-12-07 19:36:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 19:36:36 +0100 |
commit | 9620ee90be7e04b3616ce4b851abb63dbba7af7f (patch) | |
tree | f3880b9c8eda7dcc570553eec855080fd122e730 /app/javascript/mastodon/containers | |
parent | 48bef17cc990afda95c4de657f7643c321e62650 (diff) |
Fix unnecessary re-rendering of various components when typing in web UI (#15286)
Diffstat (limited to 'app/javascript/mastodon/containers')
-rw-r--r-- | app/javascript/mastodon/containers/status_container.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/javascript/mastodon/containers/status_container.js b/app/javascript/mastodon/containers/status_container.js index ef520b96a..d6bcb8973 100644 --- a/app/javascript/mastodon/containers/status_container.js +++ b/app/javascript/mastodon/containers/status_container.js @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import Status from '../components/status'; -import { makeGetStatus } from '../selectors'; +import { makeGetStatus, makeGetPictureInPicture } from '../selectors'; import { replyCompose, mentionCompose, @@ -54,14 +54,11 @@ const messages = defineMessages({ const makeMapStateToProps = () => { const getStatus = makeGetStatus(); + const getPictureInPicture = makeGetPictureInPicture(); const mapStateToProps = (state, props) => ({ status: getStatus(state, props), - - pictureInPicture: { - inUse: state.getIn(['meta', 'layout']) !== 'mobile' && state.get('picture_in_picture').statusId === props.id, - available: state.getIn(['meta', 'layout']) !== 'mobile', - }, + pictureInPicture: getPictureInPicture(state, props), }); return mapStateToProps; |