mirror of
https://github.com/yeicor-3d/yet-another-cad-viewer.git
synced 2025-12-19 22:24:17 +01:00
Fix demo
This commit is contained in:
@@ -56,8 +56,13 @@ export class NetworkManager extends EventTarget {
|
|||||||
name = name.replace('.glb', '').replace('.gltf', '');
|
name = name.replace('.glb', '').replace('.gltf', '');
|
||||||
} else {
|
} else {
|
||||||
// If there is a #name parameter in the URL, use it as the name
|
// If there is a #name parameter in the URL, use it as the name
|
||||||
let urlObj = new URL(url);
|
let hashParams: URLSearchParams
|
||||||
let hashParams = new URLSearchParams(urlObj.hash.slice(1));
|
try {
|
||||||
|
let urlObj = new URL(url);
|
||||||
|
hashParams = new URLSearchParams(urlObj.hash.slice(1));
|
||||||
|
} catch (e) {
|
||||||
|
hashParams = new URLSearchParams();
|
||||||
|
}
|
||||||
if (hashParams.has("name")) {
|
if (hashParams.has("name")) {
|
||||||
name = hashParams.get("name") || `unknown-${Math.random()}`;
|
name = hashParams.get("name") || `unknown-${Math.random()}`;
|
||||||
} else { // Default to the last part of the URL as the "name" of the model
|
} else { // Default to the last part of the URL as the "name" of the model
|
||||||
|
|||||||
Reference in New Issue
Block a user