fix missing null cases

This commit is contained in:
2021-11-29 14:59:39 -07:00
parent 26f91f4172
commit 50954a738f
2 changed files with 4 additions and 5 deletions

View File

@@ -55,7 +55,7 @@
(set block.output outputBlock)
(set block.outputStart outputStartPosition)
(set block.outputEnd outputEndPosition)))
(None
(otherwise
(break)))
(elements.push (Block block))))
elements))

View File

@@ -46,7 +46,7 @@
})))
((objectWith [type "find"] text)
(_find text))
(otherType (throw "bad message $event for KTxt2Editor"))))
(otherwise (throw "bad message $event for KTxt2Editor"))))
(window.addEventListener "scroll"
->(let [s (getState)]
@@ -399,10 +399,9 @@
(content.appendChild topLink)))
(doFor [idx element] (.slice (collect (enumerate ktxt2Elements)) elementScrollY (+ elementScrollY PAGE_SIZE))
(case element
((Comment (objectWith text))
(throw "comments are no longer a feature!"))
((Block (objectWith source output outputLocked))
(blockElements source output outputLocked idx))))
(blockElements source output outputLocked idx))
(otherwise (throw "shouldn't happen"))))
(when (> (- ktxt2Elements.length 1) (+ elementScrollY SCROLL_AMOUNT))
(let [downLink (document.createElement "a")
bottomLink (document.createElement "a")]