Skip to content

Commit 883eb33

Browse files
committed
fix(editor): disable sidebar items if base gtfs not fetched
fixes #404
1 parent d0fe9a2 commit 883eb33

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

lib/editor/components/GtfsEditor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ export default class GtfsEditor extends Component<Props, State> {
304304
const {id, name, projectId, organizationId} = feedSource
305305
editingIsDisabled = !user.permissions ||
306306
!user.permissions.hasFeedPermission(organizationId, projectId, id, 'edit-gtfs') ||
307-
feedIsLocked
307+
feedIsLocked ||
308+
!status.baseFetched
308309
if (editingIsDisabled) {
309310
console.warn(`User does not have permission to edit GTFS for ${name}.`)
310311
}

lib/editor/reducers/data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const data = (state: DataState = defaultState, action: Action): DataState => {
5757
}
5858
return update(state, {
5959
tables: {$set: feed},
60-
status: {$set: {}}
60+
status: {$set: {baseFetched: true}}
6161
})
6262
}
6363
case 'SHOW_EDITOR_MODAL':

lib/types/reducers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export type LockState = {
153153
}
154154

155155
export type EditorStatus = {
156+
baseFetched?: boolean,
156157
creatingSnapshot?: boolean,
157158
savePending?: boolean,
158159
saveSuccessful?: boolean,

0 commit comments

Comments
 (0)