[Glitch] Fix unnecessary re-rendering of various components when typing in web UI (#2063)
Port 9620ee90be
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
import Status from 'flavours/glitch/components/status';
|
||||
import { List as ImmutableList } from 'immutable';
|
||||
import { makeGetStatus } from 'flavours/glitch/selectors';
|
||||
import { makeGetStatus, makeGetPictureInPicture } from 'flavours/glitch/selectors';
|
||||
import {
|
||||
replyCompose,
|
||||
mentionCompose,
|
||||
@ -60,6 +60,7 @@ const messages = defineMessages({
|
||||
|
||||
const makeMapStateToProps = () => {
|
||||
const getStatus = makeGetStatus();
|
||||
const getPictureInPicture = makeGetPictureInPicture();
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
|
||||
@ -83,11 +84,7 @@ const makeMapStateToProps = () => {
|
||||
account: account || props.account,
|
||||
settings: state.get('local_settings'),
|
||||
prepend: prepend || props.prepend,
|
||||
|
||||
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),
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user