commit | d45c04e3febbe6e61216a6aec39e79875020b947 | [log] [tgz] |
---|---|---|
author | Adrià Vilanova Martínez <me@avm99963.com> | Sun Jun 02 19:13:38 2024 +0200 |
committer | Adrià Vilanova Martínez <me@avm99963.com> | Sun Jun 02 19:58:55 2024 +0200 |
tree | 16b18fb8f16cddae21eba0fd2789a9168bc01241 | |
parent | 7d69c3ee6f1f519db48e650325abebb6b43c9007 [diff] |
refactor: convert CCInfiniteScroll class to Typescript Change-Id: I4ec59b96a71b1a23a16f3d5dd923e9d8fd3f2638
diff --git a/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler.ts b/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler.ts index da4f5e6..e9f04ff 100644 --- a/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler.ts +++ b/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBar.handler.ts
@@ -6,6 +6,13 @@ cssSelector = '.load-more-bar'; onMutatedNode({ node }: NodeMutation) { + if (!(node instanceof Element)) { + console.error( + '[CCInfiniteScrollLoadMoreBarHandler] Node is not an Element: ', + node, + ); + return; + } this.options.ccInfiniteScroll.observeLoadMoreBar(node); } }
diff --git a/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler.ts b/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler.ts index ee54aff..8bf6fd2 100644 --- a/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler.ts +++ b/src/features/infiniteScroll/nodeWatcherHandlers/ccInfiniteScrollLoadMoreBtn.handler.ts
@@ -7,6 +7,13 @@ '.scTailwindThreadMorebuttonbutton, .scTailwindThreadMessagegapbutton'; onMutatedNode({ node }: NodeMutation) { + if (!(node instanceof Element)) { + console.error( + '[CCInfiniteScrollLoadMoreBtnHandler] Node is not an Element: ', + node, + ); + return; + } this.options.ccInfiniteScroll.observeLoadMoreInteropBtn(node); } }