blob: 89ccdf28d15540721e32e4bf7d1a23cb9f8ce13c [file] [log] [blame]
Adrià Vilanova Martínezfe694782024-11-09 20:40:43 +01001import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
2import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler';
3import { OptionsProviderPort } from '../../../../services/options/OptionsProvider';
4import ReportDialogColorThemeFix from '../../core/logic/reportDialog';
5
6/**
7 * Sets the report dialog iframe's theme to the appropriate theme.
8 */
9export default class CCDarkThemeReportDialogHandler extends CssSelectorNodeWatcherHandler {
10 cssSelector = 'iframe';
11
12 constructor(
13 private optionsProvider: OptionsProviderPort,
14 private reportDialogColorThemeFix: ReportDialogColorThemeFix,
15 ) {
16 super();
17 }
18
19 onMutatedNode(mutation: NodeMutation) {
20 this.reportDialogColorThemeFix.fixThemeIfReportDialogIframeAndApplicable(
21 mutation.node,
22 this.optionsProvider,
23 );
24 }
25}