Skip to content

Commit

Permalink
fix: fixed use of undefined variable (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
lapinozz authored Apr 29, 2020
1 parent 2d8ab5c commit 7e4ab71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/SceneItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,12 @@ class SceneItem extends Animator<SceneItemOptions, SceneItemState> {
}
public setId(id?: number | string) {
const state = this.state;
const elements = this.elements;
const length = elements.length;

state.id = id || makeId(!!length);
const elements = this.elements;

if (elements.length && !state[SELECTOR]) {
if (length && !state[SELECTOR]) {
const sceneId = toId(this.getId());

state[SELECTOR] = `[${DATA_SCENE_ID}="${sceneId}"]`;
Expand Down

0 comments on commit 7e4ab71

Please sign in to comment.