diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts index c90d48168..25972a299 100644 --- a/src/lib/stores/sdk.ts +++ b/src/lib/stores/sdk.ts @@ -94,6 +94,14 @@ export const realtime = { const endpoint = getApiEndpoint(region); if (endpoint !== clientRealtime.config.endpoint) { clientRealtime.setEndpoint(endpoint); + + /** + * Workaround: the SDK doesn't update the realtime in `setEndpoint`. + * Until that's fixed, we manually set the realtime endpoint like this: + */ + clientRealtime.setEndpointRealtime( + endpoint.replace('https://', 'wss://').replace('http://', 'ws://') + ); } return clientRealtime; } diff --git a/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte b/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte index 981efa76b..9c189d7f9 100644 --- a/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/BAAModal.svelte @@ -39,7 +39,7 @@ let error: string; onMount(async () => { - /* use console sdk here as project is not always available here. */ + /* use console sdk as project is not always available here. */ const locale = await sdk.forConsole.locale.get(); const countryList = await sdk.forConsole.locale.listCountries(); diff --git a/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte b/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte index b3da70f5d..0e9253ddc 100644 --- a/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte +++ b/src/routes/(console)/organization-[organization]/settings/Soc2Modal.svelte @@ -40,7 +40,7 @@ let error: string; onMount(async () => { - /* use console sdk here as project is not always available here. */ + /* use console sdk as project is not always available here. */ const locale = await sdk.forConsole.locale.get(); const countryList = await sdk.forConsole.locale.listCountries();