From 91dfe6bcf0ba40bb9b8b3b5be2aa6f777c28414c Mon Sep 17 00:00:00 2001 From: Jared Scheib Date: Fri, 26 Jan 2018 18:51:34 -0800 Subject: [PATCH] Refresh links every time current org is switched --- ui/src/shared/actions/auth.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/src/shared/actions/auth.js b/ui/src/shared/actions/auth.js index c782459ce8..d590520b4e 100644 --- a/ui/src/shared/actions/auth.js +++ b/ui/src/shared/actions/auth.js @@ -1,5 +1,7 @@ import {getMe as getMeAJAX, updateMe as updateMeAJAX} from 'shared/apis/auth' +import {getLinksAsync} from 'shared/actions/links' + import {publishAutoDismissingNotification} from 'shared/dispatchers' import {errorThrown} from 'shared/actions/errors' @@ -101,6 +103,10 @@ export const meChangeOrganizationAsync = ( ) dispatch(meChangeOrganizationCompleted()) 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 // instead of current behavior on both invocations of meChangeOrganization, // which is to refresh index via router.push('')