blob: 56699e94896a546c555b6c53c663fd1821fb020a [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,
);
}
}