FIX: check if dominant color is set before updating site theme color (#22658)
Currently the dominant color attribute is only set for post images (not chat). As a result, clicking lightbox images in chat will load the image within lightbox but also shows a JS error. This change ensures that the dominant color is set before attempting to update the site theme color.
This commit is contained in:
parent
72ea73988c
commit
3c1dd4a62c
|
@ -249,7 +249,9 @@ export default class DLightbox extends Component {
|
|||
#onAfterItemChange() {
|
||||
this.isLoading = false;
|
||||
|
||||
setSiteThemeColor(this.currentItem.dominantColor);
|
||||
if (this.currentItem.dominantColor) {
|
||||
setSiteThemeColor(this.currentItem.dominantColor);
|
||||
}
|
||||
|
||||
setCarouselScrollPosition({
|
||||
behavior: "smooth",
|
||||
|
|
Loading…
Reference in New Issue