diff --git a/src/extensionConsole/pages/activateExtension/ActivateExtensionCard.tsx b/src/extensionConsole/pages/activateExtension/ActivateExtensionCard.tsx index 1f10a12085..6866ed9e86 100644 --- a/src/extensionConsole/pages/activateExtension/ActivateExtensionCard.tsx +++ b/src/extensionConsole/pages/activateExtension/ActivateExtensionCard.tsx @@ -93,9 +93,7 @@ const ActivateExtensionCard: React.FunctionComponent<{ async (values: FormState, helpers: FormikProps) => { try { dispatch( - actions.activateStandaloneModDefinition({ - standaloneModDefinition: { ...extension, ...values }, - }), + actions.activateStandaloneModDefinition({ ...extension, ...values }), ); notify.success("Activated mod"); dispatch(push("/mods")); diff --git a/src/extensionConsole/pages/mods/hooks/useModsPageActions.test.tsx b/src/extensionConsole/pages/mods/hooks/useModsPageActions.test.tsx index 58137ed8a9..86d26510ff 100644 --- a/src/extensionConsole/pages/mods/hooks/useModsPageActions.test.tsx +++ b/src/extensionConsole/pages/mods/hooks/useModsPageActions.test.tsx @@ -437,14 +437,14 @@ describe("actions", () => { } = renderHook(() => useModsPageActions(modViewItem), { setupRedux(dispatch) { dispatch( - extensionActions.activateStandaloneModDefinition({ + extensionActions.activateStandaloneModDefinition( standaloneModDefinition, - }), + ), ); dispatch( - extensionActions.activateStandaloneModDefinition({ - standaloneModDefinition: standaloneModDefinitionFactory(), - }), + extensionActions.activateStandaloneModDefinition( + standaloneModDefinitionFactory(), + ), ); }, }); diff --git a/src/extensionConsole/pages/mods/modals/convertToModModal/ConvertToModModal.test.tsx b/src/extensionConsole/pages/mods/modals/convertToModModal/ConvertToModModal.test.tsx index 3b525561fc..85efd80c71 100644 --- a/src/extensionConsole/pages/mods/modals/convertToModModal/ConvertToModModal.test.tsx +++ b/src/extensionConsole/pages/mods/modals/convertToModModal/ConvertToModModal.test.tsx @@ -67,9 +67,9 @@ describe("it renders", () => { setupRedux(dispatch) { dispatch(authSlice.actions.setAuth(authStateFactory())); dispatch( - extensionsSlice.actions.activateStandaloneModDefinition({ + extensionsSlice.actions.activateStandaloneModDefinition( standaloneModDefinition, - }), + ), ); dispatch( modModalsSlice.actions.setShareContext({ @@ -90,9 +90,9 @@ describe("it renders", () => { setupRedux(dispatch) { dispatch(authSlice.actions.setAuth(anonAuth)); dispatch( - extensionsSlice.actions.activateStandaloneModDefinition({ + extensionsSlice.actions.activateStandaloneModDefinition( standaloneModDefinition, - }), + ), ); dispatch( modModalsSlice.actions.setShareContext({ @@ -147,9 +147,9 @@ describe("it renders", () => { setupRedux(dispatch) { dispatch(authSlice.actions.setAuth(authStateFactory())); dispatch( - extensionsSlice.actions.activateStandaloneModDefinition({ + extensionsSlice.actions.activateStandaloneModDefinition( standaloneModDefinition, - }), + ), ); dispatch( sharingAction({ diff --git a/src/extensionConsole/pages/mods/utils/useReinstall.test.ts b/src/extensionConsole/pages/mods/utils/useReinstall.test.ts index 7ae89b8fe6..a7beb9ad67 100644 --- a/src/extensionConsole/pages/mods/utils/useReinstall.test.ts +++ b/src/extensionConsole/pages/mods/utils/useReinstall.test.ts @@ -44,14 +44,14 @@ test("uninstalls mod components", async () => { } = renderHook(() => useReinstall(), { setupRedux(dispatch) { dispatch( - extensionActions.activateStandaloneModDefinition({ + extensionActions.activateStandaloneModDefinition( standaloneModDefinition, - }), + ), ); dispatch( - extensionActions.activateStandaloneModDefinition({ - standaloneModDefinition: anotherStandaloneModDefinition, - }), + extensionActions.activateStandaloneModDefinition( + anotherStandaloneModDefinition, + ), ); }, }); @@ -85,9 +85,9 @@ test("dispatches install recipe action", async () => { } = renderHook(() => useReinstall(), { setupRedux(dispatch) { dispatch( - extensionActions.activateStandaloneModDefinition({ + extensionActions.activateStandaloneModDefinition( standaloneModDefinition, - }), + ), ); }, }); diff --git a/src/store/checkAvailableInstalledExtensions.test.ts b/src/store/checkAvailableInstalledExtensions.test.ts index 092aeead1d..08925c9633 100644 --- a/src/store/checkAvailableInstalledExtensions.test.ts +++ b/src/store/checkAvailableInstalledExtensions.test.ts @@ -127,24 +127,14 @@ describe("checkAvailableInstalledExtensions", () => { }); store.dispatch( - optionsActions.activateStandaloneModDefinition({ - standaloneModDefinition: availableButton, - }), + optionsActions.activateStandaloneModDefinition(availableButton), ); store.dispatch( - optionsActions.activateStandaloneModDefinition({ - standaloneModDefinition: unavailableButton, - }), + optionsActions.activateStandaloneModDefinition(unavailableButton), ); + store.dispatch(optionsActions.activateStandaloneModDefinition(availableQb)); store.dispatch( - optionsActions.activateStandaloneModDefinition({ - standaloneModDefinition: availableQb, - }), - ); - store.dispatch( - optionsActions.activateStandaloneModDefinition({ - standaloneModDefinition: unavailableQb, - }), + optionsActions.activateStandaloneModDefinition(unavailableQb), ); await store.dispatch(actions.checkAvailableInstalledExtensions()); diff --git a/src/store/extensionsSlice.ts b/src/store/extensionsSlice.ts index 71af9a9c3a..984849fc05 100644 --- a/src/store/extensionsSlice.ts +++ b/src/store/extensionsSlice.ts @@ -82,11 +82,9 @@ const extensionsSlice = createSlice({ activateStandaloneModDefinition( state, { - payload, - }: PayloadAction<{ standaloneModDefinition: StandaloneModDefinition }>, + payload: standaloneModDefinition, + }: PayloadAction, ) { - const { standaloneModDefinition } = payload; - reportEvent( Events.MOD_COMPONENT_CLOUD_ACTIVATE, selectEventData(standaloneModDefinition),