bugfix: data not loading on default view

This commit is contained in:
Michael Shanks 2020-06-02 10:43:48 +01:00
parent ea5a52d61c
commit fea0203096
1 changed files with 5 additions and 1 deletions

View File

@ -30,7 +30,10 @@ export const getBackendUiStore = () => {
const views = await viewsResponse.json()
store.update(state => {
state.selectedDatabase = db
state.selectedModel = models && models.length > 0 && models[0]
if (models && models.length > 0) {
state.selectedModel = models[0]
state.selectedView = `${models[0]._id}`
}
state.breadcrumbs = [db.name]
state.models = models
state.views = views
@ -73,6 +76,7 @@ export const getBackendUiStore = () => {
state.models.push(model)
state.models = state.models
state.selectedModel = model
state.selectedView = `${model._id}`
return state
}),
},