Skip to content

Commit a545152

Browse files
committed
fix bug: for non-atomic loader, count should never small than 0
1 parent c69cf92 commit a545152

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

dist/ldld.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ldld.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ldld.ls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# if is off: off after resolve
4949
#else => setTimeout (~> @toggle(v)then ~> res!), delay
5050
new Promise (res, rej) ~>
51-
@count += d
51+
@count = (@count + d >? 0)
5252
if !force and !@opt.atomic and ( @count >= 2 or (@count == 1 and d < 0)) => return res!
5353
@root.map ~>
5454
it.classList.toggle @opt.active-class, (d > 0)

0 commit comments

Comments
 (0)