blob: c156049585852978762b3893de568a38efc10f92 [file] [log] [blame]
import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler';
import FlattenThreads, {
kReplyPayloadSelector,
} from '../../core/flattenThreads';
/** Inject parent reply quote */
export default class FlattenThreadsQuoteHandler extends CssSelectorNodeWatcherHandler {
cssSelector = kReplyPayloadSelector;
constructor(private flattenThreads: FlattenThreads) {
super();
}
onMutatedNode({ node }: NodeMutation) {
this.flattenThreads.injectQuoteIfApplicable(node);
}
}