mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 20:43:41 +00:00
window supports websockets
This commit is contained in:
committed by
Matt Hill
parent
9dfdee283a
commit
abeba45422
@@ -11,7 +11,7 @@ export function PatchDbServiceFactory (
|
||||
embassyApi: ApiService,
|
||||
): PatchDbService {
|
||||
|
||||
const { mocks, patchDb: { poll }, isConsulate } = config
|
||||
const { mocks, patchDb: { poll }, supportsWebSockets } = config
|
||||
|
||||
let source: Source<DataModel>
|
||||
|
||||
@@ -22,7 +22,7 @@ export function PatchDbServiceFactory (
|
||||
source = new WebsocketSource(`ws://localhost:${config.mocks.wsPort}/db`)
|
||||
}
|
||||
} else {
|
||||
if (isConsulate) {
|
||||
if (supportsWebSockets) {
|
||||
source = new PollSource({ ...poll }, embassyApi)
|
||||
} else {
|
||||
const protocol = window.location.protocol === 'http:' ? 'ws' : 'wss'
|
||||
|
||||
Reference in New Issue
Block a user