[WIKI-722] fix: hocuspocus provider update to v3 (#7930)

* fix: hocuspocus provider

* fix: hocuspocus updated url instead of queryparams
This commit is contained in:
M. Palanikannan 2025-10-09 15:38:15 +05:30 committed by GitHub
parent 561ae82d9d
commit 98e0089723
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 17 deletions

View file

@ -152,10 +152,17 @@ export const PageEditorBody: React.FC<Props> = observer((props) => {
const isSecureEnvironment = window.location.protocol === "https:";
WS_LIVE_URL.protocol = isSecureEnvironment ? "wss" : "ws";
WS_LIVE_URL.pathname = `${LIVE_BASE_PATH}/collaboration`;
// Append query parameters to the URL
Object.entries(webhookConnectionParams)
.filter(([_, value]) => value !== undefined && value !== null)
.forEach(([key, value]) => {
WS_LIVE_URL.searchParams.set(key, String(value));
});
// Construct realtime config
return {
url: WS_LIVE_URL.toString(),
queryParams: webhookConnectionParams,
};
} catch (error) {
console.error("Error creating realtime config", error);