mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 11:38:36 +08:00
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() {
|
#onAfterItemChange() {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
|
|
||||||
setSiteThemeColor(this.currentItem.dominantColor);
|
if (this.currentItem.dominantColor) {
|
||||||
|
setSiteThemeColor(this.currentItem.dominantColor);
|
||||||
|
}
|
||||||
|
|
||||||
setCarouselScrollPosition({
|
setCarouselScrollPosition({
|
||||||
behavior: "smooth",
|
behavior: "smooth",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user