feat: Add selected city functional with some debugging

This commit is contained in:
2025-10-22 03:04:58 +03:00
parent 9e47ab667f
commit 50ad374cf5
14 changed files with 430 additions and 175 deletions

View File

@@ -10,17 +10,9 @@ const clearGLTFCache = (url?: string) => {
// Если это blob URL, очищаем его из кеша
if (url.startsWith("blob:")) {
useGLTF.clear(url);
console.log("🧹 clearGLTFCache: Очистка blob URL из кеша GLTF", {
url,
});
} else {
useGLTF.clear(url);
console.log("🧹 clearGLTFCache: Очистка кеша для URL", { url });
}
} else {
// Очищаем весь кеш GLTF
useGLTF.clear();
console.log("🧹 clearGLTFCache: Очистка всего кеша GLTF");
}
} catch (error) {
console.warn("⚠️ clearGLTFCache: Ошибка при очистке кеша", error);
@@ -56,17 +48,6 @@ const isValid3DFile = (url: string): boolean => {
const isValid =
hasValidExtension || hasValidType || isBlobUrl || isServerUrl;
console.log("🔍 isValid3DFile: Проверка файла", {
url,
pathname,
hasValidExtension,
fileType,
hasValidType,
isBlobUrl,
isServerUrl,
isValid,
});
return isValid;
} catch (error) {
console.warn("⚠️ isValid3DFile: Ошибка при проверке URL", error);
@@ -144,15 +125,9 @@ export const ThreeView = ({
useEffect(() => {
// Очищаем кеш сразу при монтировании компонента
clearGLTFCache(fileUrl);
console.log("🧹 ThreeView: Очистка кеша модели при монтировании", {
fileUrl,
});
return () => {
clearGLTFCache(fileUrl);
console.log("🧹 ThreeView: Очистка кеша модели при размонтировании", {
fileUrl,
});
};
}, [fileUrl]);