refactor(load-drafts): migrate to the new DI architecture
Bug: twpowertools:226
Change-Id: Ia85adb1af9440182323bebf4516bbd5ee3efbe4d
diff --git a/src/entryPoints/communityConsole/contentScripts/start.ts b/src/entryPoints/communityConsole/contentScripts/start.ts
index baea65b..c408b9f 100644
--- a/src/entryPoints/communityConsole/contentScripts/start.ts
+++ b/src/entryPoints/communityConsole/contentScripts/start.ts
@@ -3,6 +3,8 @@
import DependenciesProviderSingleton, {
AutoRefreshDependency,
+ OptionsProviderDependency,
+ StartupDataStorageDependency,
} from '../../../common/architecture/dependenciesProvider/DependenciesProvider';
import { Context } from '../../../common/architecture/entrypoint/Context';
import {
@@ -19,6 +21,7 @@
import ScriptSorterAdapter from '../../../infrastructure/presentation/scripts/ScriptSorter.adapter';
import { SortedScriptsProviderAdapter } from '../../../infrastructure/presentation/scripts/SortedScriptsProvider.adapter';
import StandaloneScripts from '../../../scripts/Scripts';
+import LoadDraftsSetupScript from '../../../features/loadDrafts/presentation/scripts/setup.script';
const scriptRunner = createScriptRunner();
scriptRunner.run();
@@ -26,6 +29,12 @@
function createScriptRunner() {
const dependenciesProvider = DependenciesProviderSingleton.getInstance();
const autoRefresh = dependenciesProvider.getDependency(AutoRefreshDependency);
+ const optionsProvider = dependenciesProvider.getDependency(
+ OptionsProviderDependency,
+ );
+ const startupDataStorage = dependenciesProvider.getDependency(
+ StartupDataStorageDependency,
+ );
const context: Context = {
page: ScriptPage.CommunityConsole,
@@ -41,6 +50,7 @@
new CCDarkThemeInjectAutoDarkTheme(),
new CCDarkThemeInjectForcedDarkTheme(),
new InteropThreadPageSetupScript(),
+ new LoadDraftsSetupScript(optionsProvider, startupDataStorage),
// Non-DI scripts (legacy, should be migrated to use a DI approach)
...new Features().getScripts(context),