From bd1feb07973338e0ec89c5d6449a953bad0be03d Mon Sep 17 00:00:00 2001 From: Marijan Andonoski Date: Mon, 28 Mar 2022 16:17:57 +0200 Subject: [PATCH] #3158: sorted the issue, switched if check order. --- .../frontend/channelEdit/vuex/contentNode/getters.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/vuex/contentNode/getters.js b/contentcuration/contentcuration/frontend/channelEdit/vuex/contentNode/getters.js index 12b6b2e6b6..e4e374062f 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/vuex/contentNode/getters.js +++ b/contentcuration/contentcuration/frontend/channelEdit/vuex/contentNode/getters.js @@ -133,16 +133,17 @@ export function getContentNodeDetailsAreValid(state) { export function getContentNodeFilesAreValid(state, getters, rootState, rootGetters) { return function(contentNodeId) { const contentNode = state.contentNodesMap[contentNodeId]; + if ( + contentNode.kind === ContentKindsNames.TOPIC || + contentNode.kind === ContentKindsNames.EXERCISE + ) { + return true; + } if (contentNode && contentNode.kind !== ContentKindsNames.TOPIC) { let files = rootGetters['file/getContentNodeFiles'](contentNode.id); if (files.length) { // Don't count errors before files have loaded return !getNodeFilesErrors(files).length; - } else if ( - contentNode.kind === ContentKindsNames.TOPIC || - contentNode.kind === ContentKindsNames.EXERCISE - ) { - return true; } else { return false; }