blob: 7618b783b6436c888f1da5eec8bb34e23debe49f [file] [log] [blame]
Adrià Vilanova Martínezf4cbb6b2024-05-26 01:19:01 +02001import DependenciesProviderSingleton, {
2 OptionsProviderDependency,
3 StartupDataStorageDependency,
4} from '../../../common/architecture/dependenciesProvider/DependenciesProvider';
5import Script, {
6 ScriptEnvironment,
7 ScriptPage,
8 ScriptRunPhase,
9} from '../../../common/architecture/scripts/Script';
10
11export default class RemoveUserAbuseEventsFromDataStartupScript extends Script {
12 page = ScriptPage.CommunityConsole;
13 environment = ScriptEnvironment.ContentScript;
14 runPhase = ScriptRunPhase.Start;
15
16 async execute() {
17 const dependenciesProvider = DependenciesProviderSingleton.getInstance();
18 const optionsProvider = dependenciesProvider.getDependency(
19 OptionsProviderDependency,
20 );
21 if (optionsProvider.isEnabled('fixpekb269560789')) {
22 const startupDataStorage = dependenciesProvider.getDependency(
23 StartupDataStorageDependency,
24 );
25 startupDataStorage.enqueueModification((startupDataModel) => {
26 if (startupDataModel.data[1]?.[1]?.[8]?.[7]) {
27 delete startupDataModel.data[1]?.[1]?.[8]?.[7];
28 }
29 });
30 }
31 }
32}