Add frontend store

This commit is contained in:
Adria Navarro 2025-03-12 13:19:20 +01:00
parent e2828d955a
commit ae567817a6
3 changed files with 23 additions and 2 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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,
}