Skip to content

Commit

Permalink
Invites: Pull sites from server upon accepting
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mcsf committed May 9, 2017
1 parent 84c24b2 commit 698aa74
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/lib/invites/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -82,7 +83,7 @@ export function createAccount( userData, invite, callback ) {
callback( error, bearerToken );
}
);
}
};
}

export function acceptInvite( invite, callback ) {
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit 698aa74

Please sign in to comment.