blob: 1ab8644b5a3742dbb697042c7d79e6d606382a51 [file] [log] [blame]
Adrià Vilanova Martínez43c75202024-10-19 15:55:15 +02001import { NodeMutation } from '../../../presentation/nodeWatcher/NodeWatcherHandler';
Adrià Vilanova Martínez18d03c42024-04-21 16:43:01 +02002import CssSelectorNodeWatcherScriptHandler from '../../../common/architecture/scripts/nodeWatcher/handlers/CssSelectorNodeWatcherScriptHandler';
3import { InfiniteScrollNodeWatcherOptions } from '../scripts/ccInfiniteScroll.script';
4
5export default class CCInfiniteScrollLoadMoreBtnHandler extends CssSelectorNodeWatcherScriptHandler<InfiniteScrollNodeWatcherOptions> {
6 cssSelector =
7 '.scTailwindThreadMorebuttonbutton, .scTailwindThreadMessagegapbutton';
8
9 onMutatedNode({ node }: NodeMutation) {
Adrià Vilanova Martínezd45c04e2024-06-02 19:13:38 +020010 if (!(node instanceof Element)) {
11 console.error(
12 '[CCInfiniteScrollLoadMoreBtnHandler] Node is not an Element: ',
13 node,
14 );
15 return;
16 }
Adrià Vilanova Martínez18d03c42024-04-21 16:43:01 +020017 this.options.ccInfiniteScroll.observeLoadMoreInteropBtn(node);
18 }
19}