Fixed backGroundUrl

Former-commit-id: e2628694c61f734f52b3ac6f2ffab6c9f1b39b55
This commit is contained in:
Daniel Maya 2019-04-17 11:51:32 +02:00
parent 8e4ef972d8
commit d33a23526c
1 changed files with 9 additions and 6 deletions

View File

@ -369,9 +369,10 @@ export default class VisualConsole {
public render(prevProps: VisualConsoleProps | null = null): void {
if (prevProps) {
if (prevProps.backgroundURL !== this.props.backgroundURL) {
this.containerRef.style.backgroundImage = `url(${
this.props.backgroundURL
})`;
this.containerRef.style.backgroundImage =
this.props.backgroundURL !== null
? `url(${this.props.backgroundURL})`
: null;
}
if (prevProps.backgroundColor !== this.props.backgroundColor) {
this.containerRef.style.backgroundColor = this.props.backgroundColor;
@ -380,9 +381,11 @@ export default class VisualConsole {
this.resizeElement(this.props.width, this.props.height);
}
} else {
this.containerRef.style.backgroundImage = `url(${
this.props.backgroundURL
})`;
this.containerRef.style.backgroundImage =
this.props.backgroundURL !== null
? `url(${this.props.backgroundURL})`
: null;
this.containerRef.style.backgroundColor = this.props.backgroundColor;
this.resizeElement(this.props.width, this.props.height);
}