Skip to content
Snippets Groups Projects
Commit fe38356d authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Gh-991: Add messages for when the submission is incorrect

parent dfb662f7
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,11 @@ import { ...@@ -20,6 +20,11 @@ import {
getCurrentRoundSubmissionIDs, getCurrentRoundSubmissionIDs,
} from '@selectors/rounds'; } from '@selectors/rounds';
import {
MESSAGE_TYPES,
addMessage,
} from '@actions/messages';
// Round // Round
export const UPDATE_ROUND = 'UPDATE_ROUND'; export const UPDATE_ROUND = 'UPDATE_ROUND';
...@@ -125,6 +130,7 @@ export const loadCurrentRoundSubmissions = () => (dispatch, getState) => { ...@@ -125,6 +130,7 @@ export const loadCurrentRoundSubmissions = () => (dispatch, getState) => {
const state = getState() const state = getState()
const ids = getCurrentRoundSubmissionIDs(state) const ids = getCurrentRoundSubmissionIDs(state)
if (!ids.includes(getCurrentSubmissionID(state))) { if (!ids.includes(getCurrentSubmissionID(state))) {
dispatch(addMessage('The selected submission is not available in this view', MESSAGE_TYPES.WARNING))
return dispatch(setCurrentSubmission(null)) return dispatch(setCurrentSubmission(null))
} }
}) })
...@@ -190,6 +196,7 @@ export const loadSubmissionsForCurrentStatus = () => (dispatch, getState) => { ...@@ -190,6 +196,7 @@ export const loadSubmissionsForCurrentStatus = () => (dispatch, getState) => {
const state = getState() const state = getState()
const ids = getSubmissionIDsForCurrentStatuses(state) const ids = getSubmissionIDsForCurrentStatuses(state)
if (!ids.includes(getCurrentSubmissionID(state))) { if (!ids.includes(getCurrentSubmissionID(state))) {
dispatch(addMessage('The selected submission is not available in this view', MESSAGE_TYPES.WARNING))
return dispatch(setCurrentSubmission(null)) return dispatch(setCurrentSubmission(null))
} }
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment