blob: 1ab8644b5a3742dbb697042c7d79e6d606382a51 [file] [log] [blame]
import { NodeMutation } from '../../../presentation/nodeWatcher/NodeWatcherHandler';
import CssSelectorNodeWatcherScriptHandler from '../../../common/architecture/scripts/nodeWatcher/handlers/CssSelectorNodeWatcherScriptHandler';
import { InfiniteScrollNodeWatcherOptions } from '../scripts/ccInfiniteScroll.script';
export default class CCInfiniteScrollLoadMoreBtnHandler extends CssSelectorNodeWatcherScriptHandler<InfiniteScrollNodeWatcherOptions> {
cssSelector =
'.scTailwindThreadMorebuttonbutton, .scTailwindThreadMessagegapbutton';
onMutatedNode({ node }: NodeMutation) {
if (!(node instanceof Element)) {
console.error(
'[CCInfiniteScrollLoadMoreBtnHandler] Node is not an Element: ',
node,
);
return;
}
this.options.ccInfiniteScroll.observeLoadMoreInteropBtn(node);
}
}