Adrià Vilanova MartÃnez | 4e847f4 | 2024-11-09 23:03:32 +0100 | [diff] [blame] | 1 | import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter'; |
| 2 | import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler'; |
| 3 | import ThreadPageDesignWarning from '../../core/threadPageDesignWarning'; |
| 4 | |
| 5 | /** Inject old thread page design warning if applicable */ |
| 6 | export 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 | } |