blob: 89ccdf28d15540721e32e4bf7d1a23cb9f8ce13c [file] [log] [blame]
import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler';
import { OptionsProviderPort } from '../../../../services/options/OptionsProvider';
import ReportDialogColorThemeFix from '../../core/logic/reportDialog';
/**
* Sets the report dialog iframe's theme to the appropriate theme.
*/
export default class CCDarkThemeReportDialogHandler extends CssSelectorNodeWatcherHandler {
cssSelector = 'iframe';
constructor(
private optionsProvider: OptionsProviderPort,
private reportDialogColorThemeFix: ReportDialogColorThemeFix,
) {
super();
}
onMutatedNode(mutation: NodeMutation) {
this.reportDialogColorThemeFix.fixThemeIfReportDialogIframeAndApplicable(
mutation.node,
this.optionsProvider,
);
}
}