diff --git a/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs b/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs index 3b8fdc03..0d23dc9e 100644 --- a/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs +++ b/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs @@ -154,15 +154,26 @@ function VideoRowListRowContentTask(input as object) as object end function function RemovePlaceHolderItems(contentNode as object) + childCount = contentNode.getChildCount() + removeIndex = childCount + removeCount = 0 + + index = childCount - 1 isLoading = true - while isLoading and contentNode.getChildCount() > 0 - lastIndex = contentNode.getChildCount() - 1 - child = contentNode.getChild(lastIndex) - isLoading = IsString(child.type) and child.type = "loading" - if isLoading = true - contentNode.removeChildIndex(lastIndex) + while isLoading and index >= 0 + child = contentNode.getChild(index) + isLoading = ValidString(child.type) = "loading" + if not isLoading + exit while end if + removeCount += 1 + removeIndex -= 1 + index -= 1 end while + + if removeCount > 0 + contentNode.removeChildrenIndex(removeCount, removeIndex) + end if end function function HandleFeedLoadErrorDialog(error as object, rowList as object) as void