tidyup
This commit is contained in:
parent
4533258c4a
commit
bdc8297d68
|
@ -14,7 +14,6 @@ import {
|
||||||
|
|
||||||
export const getBackendUiStore = () => {
|
export const getBackendUiStore = () => {
|
||||||
const INITIAL_BACKEND_UI_STATE = {
|
const INITIAL_BACKEND_UI_STATE = {
|
||||||
leftNavItem: "DATABASE",
|
|
||||||
selectedView: {
|
selectedView: {
|
||||||
records: [],
|
records: [],
|
||||||
name: "",
|
name: "",
|
||||||
|
@ -27,7 +26,6 @@ export const getBackendUiStore = () => {
|
||||||
const store = writable(INITIAL_BACKEND_UI_STATE)
|
const store = writable(INITIAL_BACKEND_UI_STATE)
|
||||||
|
|
||||||
store.actions = {
|
store.actions = {
|
||||||
navigate: name => store.update(state => ({ ...state, leftNavItem: name })),
|
|
||||||
database: {
|
database: {
|
||||||
select: db =>
|
select: db =>
|
||||||
store.update(state => {
|
store.update(state => {
|
||||||
|
@ -60,10 +58,6 @@ export const getBackendUiStore = () => {
|
||||||
return state
|
return state
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
modals: {
|
|
||||||
show: modal => store.update(state => ({ ...state, visibleModal: modal })),
|
|
||||||
hide: () => store.update(state => ({ ...state, visibleModal: null })),
|
|
||||||
},
|
|
||||||
users: {
|
users: {
|
||||||
create: user =>
|
create: user =>
|
||||||
store.update(state => {
|
store.update(state => {
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
$: views = $store.hierarchy.indexes
|
$: views = $store.hierarchy.indexes
|
||||||
|
|
||||||
async function selectDatabase(database) {
|
async function selectDatabase(database) {
|
||||||
backendUiStore.actions.navigate("DATABASE")
|
|
||||||
backendUiStore.actions.records.select(null)
|
backendUiStore.actions.records.select(null)
|
||||||
backendUiStore.actions.views.select(views[0])
|
backendUiStore.actions.views.select(views[0])
|
||||||
backendUiStore.actions.database.select(database)
|
backendUiStore.actions.database.select(database)
|
||||||
|
|
Loading…
Reference in New Issue