This commit is contained in:
Yeicor
2025-08-02 14:06:21 +02:00
parent 099726035a
commit a54b91f704

View File

@@ -56,8 +56,13 @@ export class NetworkManager extends EventTarget {
name = name.replace('.glb', '').replace('.gltf', '');
} else {
// If there is a #name parameter in the URL, use it as the name
let hashParams: URLSearchParams
try {
let urlObj = new URL(url);
let hashParams = new URLSearchParams(urlObj.hash.slice(1));
hashParams = new URLSearchParams(urlObj.hash.slice(1));
} catch (e) {
hashParams = new URLSearchParams();
}
if (hashParams.has("name")) {
name = hashParams.get("name") || `unknown-${Math.random()}`;
} else { // Default to the last part of the URL as the "name" of the model