mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-16 00:00:03 +01:00
do not try to load file if no file is available for widget
This commit is contained in:
parent
5c4afb686f
commit
e09f69bd70
1 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,7 @@ class WidgetImage extends React.Component {
|
|||
componentDidMount() {
|
||||
// Query the image referenced by the widget
|
||||
let widgetFile = this.props.widget.customProperties.file;
|
||||
if (widgetFile && !this.props.files.find(file => file.id === widgetFile)) {
|
||||
if (widgetFile !== -1 && !this.props.files.find(file => file.id === widgetFile)) {
|
||||
AppDispatcher.dispatch({
|
||||
type: 'files/start-load',
|
||||
data: widgetFile,
|
||||
|
@ -39,7 +39,7 @@ class WidgetImage extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const file = this.props.files.find(file => file._id === this.props.widget.customProperties.file);
|
||||
const file = this.props.files.find(file => file.id === this.props.widget.customProperties.file);
|
||||
|
||||
return (
|
||||
<div className="full">
|
||||
|
|
Loading…
Add table
Reference in a new issue