-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix new accent color not refreshing when changing thumbnail for audio uploads #14264
Fix new accent color not refreshing when changing thumbnail for audio uploads #14264
Conversation
@@ -103,7 +103,7 @@ class Audio extends React.PureComponent { | |||
} | |||
|
|||
componentDidUpdate (prevProps, prevState) { | |||
if (prevProps.src !== this.props.src || this.state.width !== prevState.width || this.state.height !== prevState.height) { | |||
if (prevProps.src !== this.props.src || this.state.width !== prevState.width || this.state.height !== prevState.height || prevProps.accentColor !== this.props.accentColor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I suppose this needs take background and foreground colors into account too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, those are properly passed down, and not part of the canvas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, we should just make a poster
check. The colors can't change unless the poster image changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, only accentColor gets drawn currently. I see what you mean now. Yeah this makes sense then.
@@ -103,7 +103,7 @@ class Audio extends React.PureComponent { | |||
} | |||
|
|||
componentDidUpdate (prevProps, prevState) { | |||
if (prevProps.src !== this.props.src || this.state.width !== prevState.width || this.state.height !== prevState.height) { | |||
if (prevProps.src !== this.props.src || this.state.width !== prevState.width || this.state.height !== prevState.height || prevProps.accentColor !== this.props.accentColor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, we should just make a poster
check. The colors can't change unless the poster image changed.
The props are correctly passed down to the audio player, but the canvas doesn't get redrawn unless it is currently playing.
This PR changes that.