blob: 1a016fc3d9ce258b66d6564ae214ef968c6699f0 [file] [log] [blame]
Adrià Vilanova Martínez4e847f42024-11-09 23:03:32 +01001import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
2import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler';
3import ThreadPageDesignWarning from '../../core/threadPageDesignWarning';
4
5/** Inject old thread page design warning if applicable */
6export default class ThreadPageDesignWarningInjectHandler extends CssSelectorNodeWatcherHandler {
7 cssSelector = 'ec-thread > .page > .material-content > div[role="list"]';
8
9 constructor(private threadPageDesignWarning: ThreadPageDesignWarning) {
10 super();
11 }
12
13 onMutatedNode({ node }: NodeMutation) {
14 this.threadPageDesignWarning.injectWarningIfApplicable(node);
15 }
16}