Skip to content

Commit

Permalink
Use Project Manager when on local backend
Browse files Browse the repository at this point in the history
  • Loading branch information
somebody1234 authored and Procrat committed May 23, 2023
1 parent cbc3568 commit d4df6d8
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as backendModule from '../backend'
import * as backendProvider from '../../providers/backend'
import * as platformModule from '../../platform'

import GLOBAL_CONFIG from '../../../../../../../../gui/config.yaml' assert { type: 'yaml' }

// =================
// === Constants ===
// =================
Expand Down Expand Up @@ -68,15 +70,23 @@ function Ide(props: IdeProps) {
}
})()
const runNewProject = async () => {
const engineConfig =
backend.platform === platformModule.Platform.cloud
? {
rpcUrl: jsonAddress,
dataUrl: binaryAddress,
}
: {
projectManagerUrl: GLOBAL_CONFIG.projectManagerEndpoint,
}
await appRunner?.runApp({
loader: {
assetsUrl: `${assetsRoot}dynamic-assets`,
wasmUrl: `${assetsRoot}pkg-opt.wasm`,
jsUrl: `${assetsRoot}pkg${JS_EXTENSION[backend.platform]}`,
},
engine: {
rpcUrl: jsonAddress,
dataUrl: binaryAddress,
...engineConfig,
preferredVersion: engineVersion,
},
startup: {
Expand Down

0 comments on commit d4df6d8

Please sign in to comment.