Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iBicha committed Dec 8, 2023
1 parent 665f767 commit 4572420
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- A rare error when video player is closed but does not have valid content
- A rare error that can occur with loading indicators causing a crash

## [0.17.0] - 2023-11-17

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import "pkg:/source/utils/Types.bs"

function Init()
' TODO:P0 use component property with alias to fix crash
' TODO:P2 make component disposable, and stop animation when component is disposed
m.animation = m.top.findNode("loadingAnimation")
m.top.observeField("visible", FuncName(OnVisibleChanged))
OnVisibleChanged()
end function
Expand All @@ -13,10 +11,10 @@ function OnVisibleChanged()
end function

function OnIndexSet()
m.animation.delay = (m.top.index mod 5) * 0.2
m.top.animationDelay = (m.top.index mod 5) * 0.2
Animate()
end function

function Animate()
m.animation.control = m.top.visible ? "start" : "stop"
m.top.animationControl = m.top.visible ? "start" : "stop"
end function
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<field id="itemContent" type="node" onChange="OnContentSet" />
<field id="index" type="integer" onChange="OnIndexSet" />
<field id="type" type="string" value="loading" />
<field id="animationDelay" type="time" alias="loadingAnimation.delay" />
<field id="animationControl" type="string" alias="loadingAnimation.control" />
</interface>
<children>
<Rectangle
Expand Down

0 comments on commit 4572420

Please sign in to comment.