Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1143 from 18F/js-clear-notifications
Browse files Browse the repository at this point in the history
Clear notifications upon changing pages
  • Loading branch information
rememberlenny authored Jun 28, 2017
2 parents ed4c63f + b7a9185 commit 25f8098
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions static_src/components/users.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ export default class Users extends React.Component {
status="finish"
/>
);
} else {
// If there's nothing, let's reset the notification to null.
notification = null;
}

if (this.state.currentType === ORG_NAME) {
Expand Down
12 changes: 11 additions & 1 deletion static_src/stores/user_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Immutable from 'immutable';

import BaseStore from './base_store.js';
import cfApi from '../util/cf_api.js';
import { userActionTypes } from '../constants.js';
import { userActionTypes, errorActionTypes } from '../constants.js';

export class UserStore extends BaseStore {
constructor() {
Expand Down Expand Up @@ -282,6 +282,16 @@ export class UserStore extends BaseStore {
break;
}

case errorActionTypes.CLEAR: {
this._error = null;
this._saving = false;
this._inviteNotification = {};
this._inviteError = null;
this._loading = {};
this.emitChange();
break;
}

default:
break;
}
Expand Down

0 comments on commit 25f8098

Please sign in to comment.