Skip to content

Commit

Permalink
fix: generate context
Browse files Browse the repository at this point in the history
  • Loading branch information
yy-wow committed Nov 15, 2024
1 parent 1eac4d0 commit 8a17eb5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/renderer/src/RenderMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,18 @@ export const api = {
*/
export const generateContext = async (schema, metaData) => {
const { globalState, utils, dataSource } = metaData
setGlobalState(globalState)
await setUtils(utils)
setDataSourceMap(dataSource.list)

if (Array.isArray(globalState)) {
setGlobalState(globalState)
}

if (Array.isArray(utils)) {
await setUtils(utils)
}

if (Array.isArray(dataSource.list)) {
await setDataSourceMap(dataSource.list)
}

await setSchema(schema)
}

0 comments on commit 8a17eb5

Please sign in to comment.