feat: Add selected city functional with some debugging
This commit is contained in:
@@ -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