diff --git a/client/state/plugins/installed/actions.js b/client/state/plugins/installed/actions.js index 6d4e6e893caeeb..14e3b1d6982ed4 100644 --- a/client/state/plugins/installed/actions.js +++ b/client/state/plugins/installed/actions.js @@ -271,7 +271,7 @@ export function enableAutoupdatePlugin( siteId, plugin ) { dispatch( { ...defaultAction, type: PLUGIN_AUTOUPDATE_ENABLE_REQUEST } ); const afterEnableAutoupdateCallback = ( error ) => { - recordEvent( 'calypso_plugin_autoupdate_enabled', plugin, siteId, error ); + dispatch( recordEvent( 'calypso_plugin_autoupdate_enabled', plugin, siteId, error ) ); }; const successCallback = ( data ) => { @@ -306,7 +306,7 @@ export function disableAutoupdatePlugin( siteId, plugin ) { dispatch( { ...defaultAction, type: PLUGIN_AUTOUPDATE_DISABLE_REQUEST } ); const afterDisableAutoupdateCallback = ( error ) => { - recordEvent( 'calypso_plugin_autoupdate_disabled', plugin, siteId, error ); + dispatch( recordEvent( 'calypso_plugin_autoupdate_disabled', plugin, siteId, error ) ); }; const successCallback = ( data ) => { @@ -355,9 +355,7 @@ function refreshNetworkSites( siteId ) { } function installPluginHelper( siteId, plugin, isMainNetworkSite = false ) { - return ( dispatch, getState ) => { - const state = getState(); - const site = getSite( state, siteId ); + return ( dispatch ) => { const pluginId = plugin.id || plugin.slug; const defaultAction = { action: INSTALL_PLUGIN, @@ -386,7 +384,7 @@ function installPluginHelper( siteId, plugin, isMainNetworkSite = false ) { if ( INSTALL_PLUGIN === type ) { return; } - recordEvent( 'calypso_plugin_installed', plugin, site, error ); + dispatch( recordEvent( 'calypso_plugin_installed', plugin, siteId, error ) ); }; const successCallback = ( data ) => { @@ -444,9 +442,7 @@ export function installPluginOnMultisite( siteId, plugin ) { } export function removePlugin( siteId, plugin ) { - return ( dispatch, getState ) => { - const state = getState(); - const site = getSite( state, siteId ); + return ( dispatch ) => { const pluginId = plugin.id || plugin.slug; const defaultAction = { action: REMOVE_PLUGIN, @@ -456,7 +452,7 @@ export function removePlugin( siteId, plugin ) { dispatch( { ...defaultAction, type: PLUGIN_REMOVE_REQUEST } ); const recordRemovePluginEvent = ( type, error ) => { - recordEvent( 'calypso_plugin_removed', plugin, site, error ); + dispatch( recordEvent( 'calypso_plugin_removed', plugin, siteId, error ) ); }; const doDeactivate = function ( pluginData ) {