File tree 1 file changed +5
-9
lines changed
1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
1
import { datatypeXmlToJson } from 'shared/parser/pipelineXmlConverter'
2
2
3
- const { App } = window
4
- // import { baseurl } from 'shared/types'
5
- // import { useWindowStore } from 'renderer/store'
3
+ import { baseurl } from 'shared/types'
4
+ import { useWindowStore } from 'renderer/store'
6
5
7
6
async function fetchTemporaryDatatype ( id ) {
8
7
try {
9
- // let href = `${baseurl(
10
- // useWindowStore().pipeline.webservice
11
- // )}/datatypes/${id}`
12
- // TODO construct URL dynamically; the above was causing react to throw lifecycle error
13
- let href = `http://localhost:49152/ws/datatypes/${ id } `
8
+ let href = `${ baseurl (
9
+ useWindowStore ( ) . pipeline . webservice
10
+ ) } /datatypes/${ id } `
14
11
// can't use IPC fetch due to async problems matching event send and receive
15
12
// when multiple controls could be sending the same type of event
16
13
// however this browser-based fetch is at risk of CORS issues depending on how the pipeline engine
@@ -19,7 +16,6 @@ async function fetchTemporaryDatatype(id) {
19
16
// datatypes aren't at the global /datatypes endpoint
20
17
let data = await fetch ( href )
21
18
let txt = await data . text ( )
22
- console . log ( `data for ${ id } : \n` , txt )
23
19
let datatypeAsJson = datatypeXmlToJson ( href , id , txt )
24
20
return datatypeAsJson ?? null
25
21
} catch ( err ) {
You can’t perform that action at this time.
0 commit comments