feat: Add selected city functional with some debugging
This commit is contained in:
@@ -28,11 +28,8 @@ export const clearGLTFCacheForUrl = async (url: string) => {
|
||||
const gltf = await initializeUseGLTF();
|
||||
if (gltf && gltf.clear) {
|
||||
gltf.clear(url);
|
||||
console.log("🧹 GLTFCacheManager: Очистка кеша для URL", { url });
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn("⚠️ GLTFCacheManager: Ошибка при очистке кеша для URL", error);
|
||||
}
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -43,11 +40,8 @@ export const clearAllGLTFCache = async () => {
|
||||
const gltf = await initializeUseGLTF();
|
||||
if (gltf && gltf.clear) {
|
||||
gltf.clear();
|
||||
console.log("🧹 GLTFCacheManager: Очистка всего кеша GLTF");
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn("⚠️ GLTFCacheManager: Ошибка при очистке всего кеша", error);
|
||||
}
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -57,10 +51,7 @@ export const revokeBlobURL = (url: string) => {
|
||||
if (url && url.startsWith("blob:")) {
|
||||
try {
|
||||
URL.revokeObjectURL(url);
|
||||
console.log("🧹 GLTFCacheManager: Отзыв blob URL", { url });
|
||||
} catch (error) {
|
||||
console.warn("⚠️ GLTFCacheManager: Ошибка при отзыве blob URL", error);
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -73,8 +64,6 @@ export const clearBlobAndGLTFCache = async (url: string) => {
|
||||
|
||||
// Затем очищаем кеш GLTF
|
||||
await clearGLTFCacheForUrl(url);
|
||||
|
||||
console.log("🧹 GLTFCacheManager: Комплексная очистка выполнена", { url });
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -85,12 +74,7 @@ export const clearMediaTransitionCache = async (
|
||||
newMediaId: string | number | null,
|
||||
newMediaType?: number
|
||||
) => {
|
||||
console.log("🔄 GLTFCacheManager: Очистка кеша при смене медиа", {
|
||||
previousMediaId,
|
||||
newMediaId,
|
||||
newMediaType,
|
||||
});
|
||||
|
||||
console.log(newMediaId, newMediaType);
|
||||
// Если переключаемся с/на 3D модель, очищаем весь кеш
|
||||
if (newMediaType === 6 || previousMediaId) {
|
||||
await clearAllGLTFCache();
|
||||
|
||||
@@ -247,10 +247,6 @@ export const UploadMediaDialog = observer(
|
||||
setMediaUrl(newBlobUrl);
|
||||
previousMediaUrlRef.current = newBlobUrl; // Сохраняем новый URL в ref
|
||||
setIsPreviewLoaded(false); // Сбрасываем состояние загрузки при смене файла
|
||||
console.log("🆕 UploadMediaDialog: Создан новый blob URL", {
|
||||
newBlobUrl,
|
||||
fileName: mediaFile.name,
|
||||
});
|
||||
}
|
||||
}, [mediaFile]); // Убираем mediaUrl из зависимостей чтобы избежать зацикливания
|
||||
|
||||
|
||||
@@ -551,7 +551,6 @@ class CreateSightStore {
|
||||
});
|
||||
}
|
||||
|
||||
console.log("Sight created with ID:", newSightId);
|
||||
// Optionally: this.clearCreateSight(); // To reset form after successful creation
|
||||
this.needLeaveAgree = false;
|
||||
return newSightId;
|
||||
|
||||
@@ -134,7 +134,6 @@ class RouteStore {
|
||||
|
||||
copyRouteAction = async (id: number) => {
|
||||
const response = await authInstance.post(`/route/${id}/copy`);
|
||||
console.log(response);
|
||||
|
||||
runInAction(() => {
|
||||
this.routes.data = [...this.routes.data, response.data];
|
||||
|
||||
@@ -228,21 +228,13 @@ class SnapshotStore {
|
||||
// Попытка очистить кеш браузера (если поддерживается)
|
||||
if ("caches" in window) {
|
||||
try {
|
||||
caches
|
||||
.keys()
|
||||
.then((cacheNames) => {
|
||||
return Promise.all(
|
||||
cacheNames.map((cacheName) => {
|
||||
return caches.delete(cacheName);
|
||||
})
|
||||
);
|
||||
})
|
||||
.then(() => {
|
||||
console.log("Кеш браузера очищен");
|
||||
})
|
||||
.catch((error) => {
|
||||
console.warn("Не удалось очистить кеш браузера:", error);
|
||||
});
|
||||
caches.keys().then((cacheNames) => {
|
||||
return Promise.all(
|
||||
cacheNames.map((cacheName) => {
|
||||
return caches.delete(cacheName);
|
||||
})
|
||||
);
|
||||
});
|
||||
} catch (error) {
|
||||
console.warn("Кеш браузера не поддерживается:", error);
|
||||
}
|
||||
@@ -251,30 +243,20 @@ class SnapshotStore {
|
||||
// Попытка очистить IndexedDB (если поддерживается)
|
||||
if ("indexedDB" in window) {
|
||||
try {
|
||||
indexedDB
|
||||
.databases()
|
||||
.then((databases) => {
|
||||
return Promise.all(
|
||||
databases.map((db) => {
|
||||
if (db.name) {
|
||||
return indexedDB.deleteDatabase(db.name);
|
||||
}
|
||||
return Promise.resolve();
|
||||
})
|
||||
);
|
||||
})
|
||||
.then(() => {
|
||||
console.log("IndexedDB очищен");
|
||||
})
|
||||
.catch((error) => {
|
||||
console.warn("Не удалось очистить IndexedDB:", error);
|
||||
});
|
||||
indexedDB.databases().then((databases) => {
|
||||
return Promise.all(
|
||||
databases.map((db) => {
|
||||
if (db.name) {
|
||||
return indexedDB.deleteDatabase(db.name);
|
||||
}
|
||||
return Promise.resolve();
|
||||
})
|
||||
);
|
||||
});
|
||||
} catch (error) {
|
||||
console.warn("IndexedDB не поддерживается:", error);
|
||||
}
|
||||
}
|
||||
|
||||
console.log("Все кеши приложения сброшены");
|
||||
};
|
||||
|
||||
getSnapshots = async () => {
|
||||
|
||||
Reference in New Issue
Block a user