mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-30 05:25:00 +02:00
handle undefined PulseUrl in createPulseClient function (#9864)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -493,7 +493,7 @@ export async function configurePlatform() {
|
||||
|
||||
setMetadata(billingPlugin.metadata.BillingURL, config.BILLING_URL ?? '')
|
||||
|
||||
setMetadata(presentation.metadata.PulseUrl, config.PULSE_URL ?? '')
|
||||
setMetadata(presentation.metadata.PulseUrl, config.PULSE_URL)
|
||||
|
||||
const languages = myBranding.languages
|
||||
? (myBranding.languages as string).split(',').map((l) => l.trim())
|
||||
|
||||
@@ -25,13 +25,10 @@ function getWorkspace (): string {
|
||||
return getMetadata(presentation.metadata.WorkspaceUuid) ?? ''
|
||||
}
|
||||
|
||||
export function getPulseClient (): HulypulseClient | undefined {
|
||||
return pulseclient
|
||||
}
|
||||
|
||||
export async function createPulseClient (): Promise<HulypulseClient> {
|
||||
export async function createPulseClient (): Promise<HulypulseClient | undefined> {
|
||||
if (pulseclient == null) {
|
||||
const wsPulseUrl = getMetadata(presentation.metadata.PulseUrl)
|
||||
if (wsPulseUrl == null || wsPulseUrl.trim().length === 0) return undefined
|
||||
const token = getMetadata(presentation.metadata.Token)
|
||||
pulseclient = await HulypulseClient.connect(`${wsPulseUrl}?token=${token}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user