Adrià Vilanova MartÃnez | f4cbb6b | 2024-05-26 01:19:01 +0200 | [diff] [blame] | 1 | import DependenciesProviderSingleton, { |
| 2 | OptionsProviderDependency, |
| 3 | StartupDataStorageDependency, |
| 4 | } from '../../../common/architecture/dependenciesProvider/DependenciesProvider'; |
| 5 | import Script, { |
| 6 | ScriptEnvironment, |
| 7 | ScriptPage, |
| 8 | ScriptRunPhase, |
| 9 | } from '../../../common/architecture/scripts/Script'; |
| 10 | |
| 11 | export 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 | } |