From 698aa745f5bb2a55f7ea407129d5f0acde5ff84c Mon Sep 17 00:00:00 2001 From: Miguel Fonseca Date: Mon, 8 May 2017 17:57:26 +0100 Subject: [PATCH] Invites: Pull sites from server upon accepting Before #13094, this behavior was ensured by the `acceptInvite` action creator, which dispatches old Flux actions that `lib/sites-list` listens to in order to call a `sync` on itself. --- client/lib/invites/actions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/lib/invites/actions.js b/client/lib/invites/actions.js index 996b47bad1d5c..de9cbccab34df 100644 --- a/client/lib/invites/actions.js +++ b/client/lib/invites/actions.js @@ -15,6 +15,7 @@ import { action as ActionTypes } from 'lib/invites/constants'; import analytics from 'lib/analytics'; import { errorNotice, successNotice } from 'state/notices/actions'; import { acceptedNotice } from 'my-sites/invites/utils'; +import { requestSites } from 'state/sites/actions'; /** * Module variables @@ -82,7 +83,7 @@ export function createAccount( userData, invite, callback ) { callback( error, bearerToken ); } ); - } + }; } export function acceptInvite( invite, callback ) { @@ -113,12 +114,13 @@ export function acceptInvite( invite, callback ) { } analytics.tracks.recordEvent( 'calypso_invite_accepted' ); } + dispatch( requestSites() ); if ( typeof callback === 'function' ) { callback( error, data ); } } ); - } + }; } export function sendInvites( siteId, usernamesOrEmails, role, message, formId ) { @@ -178,7 +180,7 @@ export function sendInvites( siteId, usernamesOrEmails, role, message, formId ) analytics.tracks.recordEvent( 'calypso_invite_send_success' ); } } ); - } + }; } export function createInviteValidation( siteId, usernamesOrEmails, role ) {