Skip to content

Commit

Permalink
fix(scene): Default values for fixtures & animations
Browse files Browse the repository at this point in the history
Set default values for the fixtures & animations of a scene. Make sure that animations exist on a
scene when checking if the scene has no animations.
  • Loading branch information
TimPietrusky committed Oct 22, 2019
1 parent 47b9f95 commit 44e3566
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/components/scene-manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class SceneManager extends connect(store)(LitElement) {
}
}

constructor() {
super()

this._fixtures = []
this._animations = []
}

_stateChanged(state) {
this.scenes = getScenesSorted(state)
this.fixtureManager = getFixtures(state)
Expand Down
2 changes: 1 addition & 1 deletion src/components/timeline/timeline-scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TimelineScene extends connect(store)(LitElement) {
*/
noAnimationInScene(animations) {

if (animations.length === 0) {
if (animations === undefined || animations.length === 0) {
return html`<mwc-icon title="No animation is assigned to this Scene">error</mwc-icon>`
}

Expand Down

0 comments on commit 44e3566

Please sign in to comment.