Skip to content

Commit

Permalink
Fix missing dispatch calls for recordEvent thunk (#51935)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasfoo authored Apr 16, 2021
1 parent 8422bb4 commit ab8a47b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions client/state/plugins/installed/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) => {
Expand Down Expand Up @@ -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 ) => {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 ) => {
Expand Down Expand Up @@ -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,
Expand All @@ -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 ) {
Expand Down

0 comments on commit ab8a47b

Please sign in to comment.