Merge pull request #7907 from Budibase/fix/turnoff-socketio-cloud

turn off websockets in client lib in cloud
This commit is contained in:
Martin McKeaveney 2022-09-22 15:14:17 +01:00 committed by GitHub
commit 5a9ef6ff3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1,12 +1,13 @@
import { builderStore } from "./stores/index.js"
import { builderStore, environmentStore } from "./stores/index.js"
import { get } from "svelte/store"
import { io } from "socket.io-client"
export const initWebsocket = () => {
const { inBuilder, location } = get(builderStore)
const { cloud } = get(environmentStore)
// Only connect when we're inside the builder preview, for now
if (!inBuilder || !location) {
if (!inBuilder || !location || cloud) {
return
}