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

Commit

Permalink
Error notification gets recreated when navigating after failed proces…
Browse files Browse the repository at this point in the history
…s start #1150
  • Loading branch information
wiadev committed Aug 24, 2017
1 parent b715a63 commit 6bce723
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/actions/AppActions.js
Expand Up @@ -322,6 +322,12 @@ export function deleteNotification(key){
}
}

export function clearNotifications() {
return {
type: types.CLEAR_NOTIFICATIONS,
}
}

export function updateUri(pathname, query, prop, value) {
return (dispatch) => {
let url = pathname + '?';
Expand Down
3 changes: 3 additions & 0 deletions src/actions/WindowActions.js
Expand Up @@ -646,7 +646,10 @@ export function createProcess(processType, viewId, type, ids, tabId, rowId) {
startProcess(processType, pid).then(response => {
dispatch(handleProcessResponse(response, processType, pid));
}).catch(err => {
dispatch(closeModal());

dispatch(setProcessSaved());

throw err;
});
}
Expand Down
1 change: 1 addition & 0 deletions src/constants/ActionTypes.js
Expand Up @@ -37,6 +37,7 @@ export const CHANGE_INDICATOR_STATE = 'CHANGE_INDICATOR_STATE';
export const ADD_NOTIFICATION = 'ADD_NOTIFICATION';
export const SET_NOTIFICATION_PROGRESS = 'SET_NOTIFICATION_PROGRESS';
export const DELETE_NOTIFICATION = 'DELETE_NOTIFICATION';
export const CLEAR_NOTIFICATIONS = 'CLEAR_NOTIFICATIONS';
// END OF NOTIFICATION ACTIONS

//AUTH ACTIONS
Expand Down
5 changes: 5 additions & 0 deletions src/reducers/appHandler.js
Expand Up @@ -70,6 +70,11 @@ export default function appHandler(state = initialState, action) {
}, {})
});

case types.CLEAR_NOTIFICATIONS:
return Object.assign({}, state, {
notifications: {}
});

// END OF NOTIFICATION ACTIONS
case types.GET_NOTIFICATIONS_SUCCESS:
return Object.assign({}, state, {
Expand Down
6 changes: 5 additions & 1 deletion src/routes.js
Expand Up @@ -14,7 +14,8 @@ import {
logoutRequest,
logoutSuccess,
loginSuccess,
localLoginRequest
localLoginRequest,
clearNotifications
} from './actions/AppActions';

import {
Expand All @@ -35,7 +36,10 @@ export const getRoutes = (store, auth) => {
}
})
}else{
store.dispatch(clearNotifications());

store.dispatch(loginSuccess(auth));

callback();
}
}
Expand Down

0 comments on commit 6bce723

Please sign in to comment.