Sync BIM login state and stabilize zoom

This commit is contained in:
CODEX
2026-06-23 19:28:47 +03:00
parent ce34ecdd4d
commit 249d46c7c7
2 changed files with 65 additions and 2 deletions
+24 -2
View File
@@ -447,9 +447,10 @@ const configureCameraControl = () => {
if (!control) return;
activeZoomSpeed = normalizeZoomSpeed(activeZoomSpeed);
configureCameraPanMap(control);
control.followPointer = true;
// Keep wheel dolly speed independent from whether the pointer is over model geometry.
control.followPointer = false;
control.doublePickFlyTo = false;
control.smartPivot = true;
control.smartPivot = false;
control.zoomOnMouseWheel = true;
control.keyboardDollyRate = CAMERA_CONTROL_SETTINGS.keyboardDollyRate;
control.mouseWheelDollyRate = activeZoomSpeed;
@@ -684,6 +685,8 @@ let nodeDCLogoutHandling = false;
let nodeDCLoginHandling = false;
let nodeDCSessionWatchTimer = null;
let nodeDCSessionWatchInFlight = false;
let nodeDCLoginSyncPrimed = false;
let nodeDCLoginSyncEventId = "";
const handleNodeDCSessionLogout = async () => {
if (nodeDCLogoutHandling) return;
@@ -844,9 +847,24 @@ const scheduleShareSessionPromotion = (shareToken) => {
document.body.appendChild(iframe);
};
const getLoginSyncEventId = (sessionPayload) => (
typeof sessionPayload?.loginSyncEventId === "string" ? sessionPayload.loginSyncEventId : ""
);
const applyLiveSessionPayload = async (sessionPayload, { reason = "watch" } = {}) => {
const wasAuthenticated = runtimeSessionInfo.authenticated === true;
const isAuthenticated = sessionPayload?.authenticated === true;
const loginSyncEventId = getLoginSyncEventId(sessionPayload);
const hasNewLoginSyncEvent =
nodeDCLoginSyncPrimed &&
!isAuthenticated &&
!!loginSyncEventId &&
loginSyncEventId !== nodeDCLoginSyncEventId;
nodeDCLoginSyncPrimed = true;
if (loginSyncEventId) {
nodeDCLoginSyncEventId = loginSyncEventId;
}
runtimeSessionInfo = {
...runtimeSessionInfo,
@@ -861,6 +879,10 @@ const applyLiveSessionPayload = async (sessionPayload, { reason = "watch" } = {}
await handleNodeDCSessionLogout();
return;
}
if (hasNewLoginSyncEvent) {
handleNodeDCSessionLogin();
return;
}
const shareToken = getShareTokenFromPath();
if (shareToken && viewerMode === "guest") {
scheduleShareSessionPromotion(shareToken);