Promote authenticated BIM share viewers
This commit is contained in:
@@ -4,7 +4,7 @@ const SDK_URL = "./lib/dc-camera-context.es.js?v=3";
|
||||
import { createLogo } from "./src/ui/logo.js";
|
||||
import { applyToolbarVars } from "./src/ui/toolbar.js?v=3";
|
||||
import { createTemplatesMenu } from "./src/ui/templatesMenu.js?v=3";
|
||||
import { createSettingsMenu } from "./src/ui/settingsMenu.js?v=14";
|
||||
import { createSettingsMenu } from "./src/ui/settingsMenu.js?v=15";
|
||||
import { createMeasurementModal } from "./src/ui/measurementModal.js";
|
||||
import { createGlassSelect } from "./src/ui/glassSelect.js";
|
||||
import { createColorControl } from "./src/ui/controls/color.js";
|
||||
@@ -1774,6 +1774,14 @@ const initializeRuntimeMode = async () => {
|
||||
console.warn("BIM session status unavailable", err);
|
||||
}
|
||||
|
||||
if (shareToken) {
|
||||
const authenticatedShare = runtimeSessionInfo.authenticated === true ||
|
||||
startupSharePayload?.authenticated === true ||
|
||||
startupSharePayload?.mode === "standard" ||
|
||||
startupSharePayload?.readonly === false;
|
||||
viewerMode = authenticatedShare ? "standard" : "guest";
|
||||
}
|
||||
|
||||
applyRuntimeMode();
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -651,6 +651,6 @@
|
||||
<input id="fileInput" class="hidden" type="file"
|
||||
accept=".xkt,.glb,.gltf,.bim,.las,.laz,.obj,.stl">
|
||||
|
||||
<script type="module" src="/dcViewer.js?v=55"></script>
|
||||
<script type="module" src="/dcViewer.js?v=56"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -76,10 +76,13 @@ const isSharedViewerPath = () => (
|
||||
typeof window !== "undefined" &&
|
||||
/^\/share\/[^/]+\/?$/.test(window.location.pathname || "")
|
||||
);
|
||||
const isReadonlySettingsContext = () => (
|
||||
isSharedViewerPath() ||
|
||||
(typeof document !== "undefined" && document.body?.dataset?.viewerMode === "guest")
|
||||
);
|
||||
const isReadonlySettingsContext = () => {
|
||||
if (typeof document !== "undefined") {
|
||||
const mode = document.body?.dataset?.viewerMode;
|
||||
if (mode) return mode === "guest";
|
||||
}
|
||||
return isSharedViewerPath();
|
||||
};
|
||||
const projectSettings = typeof window !== "undefined" && window.__BIMDC_THEME__
|
||||
? { ...defaultSettings, ...window.__BIMDC_THEME__ }
|
||||
: { ...defaultSettings };
|
||||
|
||||
Reference in New Issue
Block a user