Ensure builder websocket is only instantiated once
This commit is contained in:
parent
fd8400bee5
commit
5d14bb70c6
|
@ -117,10 +117,13 @@ export const getFrontendStore = () => {
|
||||||
reset: () => {
|
reset: () => {
|
||||||
store.set({ ...INITIAL_FRONTEND_STATE })
|
store.set({ ...INITIAL_FRONTEND_STATE })
|
||||||
websocket?.disconnect()
|
websocket?.disconnect()
|
||||||
|
websocket = null
|
||||||
},
|
},
|
||||||
initialise: async pkg => {
|
initialise: async pkg => {
|
||||||
const { layouts, screens, application, clientLibPath, hasLock } = pkg
|
const { layouts, screens, application, clientLibPath, hasLock } = pkg
|
||||||
|
if (!websocket) {
|
||||||
websocket = createBuilderWebsocket(application.appId)
|
websocket = createBuilderWebsocket(application.appId)
|
||||||
|
}
|
||||||
await store.actions.components.refreshDefinitions(application.appId)
|
await store.actions.components.refreshDefinitions(application.appId)
|
||||||
|
|
||||||
// Reset store state
|
// Reset store state
|
||||||
|
|
Loading…
Reference in New Issue