Skip to content

Commit

Permalink
fixes: #6. Getting a vyi from a frame returns undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleactii committed Nov 2, 2024
1 parent 414b2c8 commit 54470ea
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/frame.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ export class Frame {
* @type {Icon}
*/
parent;
/**
* The vyi this frame belongs to.
* @private
* @type {VYI}
*/
vyi;
/**
* The default delay in ms of frames.
* @private
Expand Down Expand Up @@ -77,7 +71,6 @@ export class Frame {
if (!pParent || this.parent) return;
if (pParent instanceof Icon) {
this.parent = pParent;
this.vyi = pParent.vyi;
// If no delay is found, get it from the parent.
if (!this.getDelay()) {
this.setDelay(this.parent.getDelay());
Expand Down Expand Up @@ -168,7 +161,7 @@ export class Frame {
* @returns {VYI} The vyi this frame belongs to.
*/
getVyi() {
return this.vyi;
return this?.parent?.vyi;
}
/**
* Gets the icon this frame belongs to.
Expand Down

0 comments on commit 54470ea

Please sign in to comment.