Skip to content

Commit 368ef14

Browse files
committed
fix(editor): only check entity validity if it is not a new entity
fixes #147
1 parent 153291a commit 368ef14

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/manager/actions/versions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {SECURE_API_PREFIX} from '../../common/constants'
88
import {getConfigProperty} from '../../common/util/config'
99
import {uploadFile} from '../../common/util/upload-file'
1010
import fileDownload from '../../common/util/file-download'
11+
import {ENTITY} from '../../editor/constants'
1112
import {getKeyForId} from '../../editor/util/gtfs'
1213
import {getEntityGraphQLRoot, getEntityIdField, getGraphQLFieldsForEntity} from '../../gtfs/util'
1314
import {handleJobResponse, setErrorMessage, startJobMonitor} from './status'
@@ -217,7 +218,9 @@ export function fetchGTFSEntities ({namespace, id, type, editor = false, replace
217218
.then(data => {
218219
dispatch(receiveGTFSEntities({namespace, id, component: type, data, editor, replaceNew}))
219220
const activePatternId = patternId || getState().editor.data.active.subEntityId
220-
checkEntityIdValidity(data, type, id, activePatternId)
221+
if (activePatternId !== ENTITY.NEW_ID) {
222+
checkEntityIdValidity(data, type, id, activePatternId)
223+
}
221224
if (replaceNew) {
222225
// FIXME Verify this is working properly.
223226
const {feedSourceId} = getState().editor.data.active

0 commit comments

Comments
 (0)