Add frontend store
This commit is contained in:
parent
e2828d955a
commit
ae567817a6
|
@ -37,6 +37,9 @@ import { flags } from "./flags"
|
|||
import { rowActions } from "./rowActions"
|
||||
import componentTreeNodesStore from "./componentTreeNodes"
|
||||
import { appPublished } from "./published"
|
||||
import { oauth2 } from "./oauth2"
|
||||
|
||||
import { FetchAppPackageResponse } from "@budibase/types"
|
||||
|
||||
export {
|
||||
componentTreeNodesStore,
|
||||
|
@ -77,6 +80,7 @@ export {
|
|||
screenComponentsList,
|
||||
screenComponentErrors,
|
||||
screenComponentErrorList,
|
||||
oauth2,
|
||||
}
|
||||
|
||||
export const reset = () => {
|
||||
|
@ -106,7 +110,7 @@ const resetBuilderHistory = () => {
|
|||
automationHistoryStore.reset()
|
||||
}
|
||||
|
||||
export const initialise = async pkg => {
|
||||
export const initialise = async (pkg: FetchAppPackageResponse) => {
|
||||
const { application } = pkg
|
||||
// must be first operation to make sure subsequent requests have correct app ID
|
||||
appStore.syncAppPackage(pkg)
|
|
@ -15,7 +15,7 @@ export class NavigationStore extends BudiStore<AppNavigation> {
|
|||
super(INITIAL_NAVIGATION_STATE)
|
||||
}
|
||||
|
||||
syncAppNavigation(nav: AppNavigation) {
|
||||
syncAppNavigation(nav?: AppNavigation) {
|
||||
this.update(state => ({
|
||||
...state,
|
||||
...nav,
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import { BudiStore } from "@/stores/BudiStore"
|
||||
|
||||
interface Config {
|
||||
name: string
|
||||
}
|
||||
|
||||
export class OAuth2Store extends BudiStore<Config[]> {
|
||||
constructor() {
|
||||
super([])
|
||||
}
|
||||
}
|
||||
|
||||
const store = new OAuth2Store()
|
||||
|
||||
export const oauth2 = {
|
||||
...store,
|
||||
}
|
Loading…
Reference in New Issue