Skip to content

Commit

Permalink
fix(admin): make sure the status message is cleared when updating users
Browse files Browse the repository at this point in the history
fixes #408
  • Loading branch information
evansiroky committed Feb 6, 2019
1 parent 7ac5a6a commit 2f3fe7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/manager/actions/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {RecentActivity, UserProfile} from '../../types'
import type {dispatchFn, getStateFn, ManagerUserState} from '../../types/reducers'

const checkingExistingLogin = createVoidPayloadAction('CHECKING_EXISTING_LOGIN')
const clearStatusMessage = createVoidPayloadAction('CLEAR_STATUS_MESSAGE')
const receiveRecentActivity = createAction(
'RECEIVE_USER_RECENT_ACTIVITY',
(payload: Array<RecentActivity>) => payload
Expand Down Expand Up @@ -256,6 +257,12 @@ export function updateUserData (user: any, userData: any) {
// If user being updated matches the logged in user, update their
// profile in the application state.
dispatch(userProfileUpdated(updatedProfile))
} else {
// a different user than the current user was updated. An action needs
// to be dispatched because the status message from the
// updatingUserData is still set to something, so we need to indicate
// that the request completed.
dispatch(clearStatusMessage())
}
})
}
Expand Down
1 change: 1 addition & 0 deletions lib/manager/reducers/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ const config = (state: StatusState = defaultState, action: Action): StatusState
return update(state, {jobMonitor: {jobs: {$set: updatedJobs}}})

// ***** The following actions simply blank out the status message ******
case 'CLEAR_STATUS_MESSAGE':
case 'RECEIVE_PROJECTS':
case 'RECEIVE_PROJECT':
case 'RECEIVE_SYNC':
Expand Down

0 comments on commit 2f3fe7a

Please sign in to comment.