Refresh links every time current org is switched

pull/10616/head
Jared Scheib 2018-01-26 18:51:34 -08:00
parent aea9b5b918
commit 91dfe6bcf0
1 changed files with 6 additions and 0 deletions

View File

@ -1,5 +1,7 @@
import {getMe as getMeAJAX, updateMe as updateMeAJAX} from 'shared/apis/auth' import {getMe as getMeAJAX, updateMe as updateMeAJAX} from 'shared/apis/auth'
import {getLinksAsync} from 'shared/actions/links'
import {publishAutoDismissingNotification} from 'shared/dispatchers' import {publishAutoDismissingNotification} from 'shared/dispatchers'
import {errorThrown} from 'shared/actions/errors' import {errorThrown} from 'shared/actions/errors'
@ -101,6 +103,10 @@ export const meChangeOrganizationAsync = (
) )
dispatch(meChangeOrganizationCompleted()) dispatch(meChangeOrganizationCompleted())
dispatch(meGetCompleted({me, auth, logoutLink})) dispatch(meGetCompleted({me, auth, logoutLink}))
// refresh links after every successful meChangeOrganization to refresh
// /organizations/:id/users link for Admin / Current Org Users page to load
dispatch(getLinksAsync())
// TODO: reload sources upon me change org if non-refresh behavior preferred // TODO: reload sources upon me change org if non-refresh behavior preferred
// instead of current behavior on both invocations of meChangeOrganization, // instead of current behavior on both invocations of meChangeOrganization,
// which is to refresh index via router.push('') // which is to refresh index via router.push('')