Fix unnecessary re-rendering of various components when typing in web UI (#15286)
This commit is contained in:
parent
48bef17cc9
commit
9620ee90be
6 changed files with 43 additions and 23 deletions
|
@ -97,7 +97,7 @@ class Status extends ImmutablePureComponent {
|
|||
cachedMediaWidth: PropTypes.number,
|
||||
scrollKey: PropTypes.string,
|
||||
deployPictureInPicture: PropTypes.func,
|
||||
pictureInPicture: PropTypes.shape({
|
||||
pictureInPicture: ImmutablePropTypes.contains({
|
||||
inUse: PropTypes.bool,
|
||||
available: PropTypes.bool,
|
||||
}),
|
||||
|
@ -354,7 +354,7 @@ class Status extends ImmutablePureComponent {
|
|||
status = status.get('reblog');
|
||||
}
|
||||
|
||||
if (pictureInPicture.inUse) {
|
||||
if (pictureInPicture.get('inUse')) {
|
||||
media = <PictureInPicturePlaceholder width={this.props.cachedMediaWidth} />;
|
||||
} else if (status.get('media_attachments').size > 0) {
|
||||
if (this.props.muted) {
|
||||
|
@ -381,7 +381,7 @@ class Status extends ImmutablePureComponent {
|
|||
width={this.props.cachedMediaWidth}
|
||||
height={110}
|
||||
cacheWidth={this.props.cacheMediaWidth}
|
||||
deployPictureInPicture={pictureInPicture.available ? this.handleDeployPictureInPicture : undefined}
|
||||
deployPictureInPicture={pictureInPicture.get('available') ? this.handleDeployPictureInPicture : undefined}
|
||||
/>
|
||||
)}
|
||||
</Bundle>
|
||||
|
@ -404,7 +404,7 @@ class Status extends ImmutablePureComponent {
|
|||
sensitive={status.get('sensitive')}
|
||||
onOpenVideo={this.handleOpenVideo}
|
||||
cacheWidth={this.props.cacheMediaWidth}
|
||||
deployPictureInPicture={pictureInPicture.available ? this.handleDeployPictureInPicture : undefined}
|
||||
deployPictureInPicture={pictureInPicture.get('available') ? this.handleDeployPictureInPicture : undefined}
|
||||
visible={this.state.showMedia}
|
||||
onToggleVisibility={this.handleToggleMediaVisibility}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue