feat: update map, admin to and cache

This commit is contained in:
2026-05-08 13:33:41 +03:00
parent 4bda233b63
commit 193f53c029
22 changed files with 191 additions and 107 deletions

View File

@@ -8,7 +8,7 @@ import {
Box,
} from "@mui/material";
import { observer } from "mobx-react-lite";
import { authStore, cityStore, selectedCityStore, type City } from "@shared";
import { authStore, cityStore, selectedCityStore, snapshotStore, type City } from "@shared";
import { MapPin } from "lucide-react";
export const CitySelector: React.FC = observer(() => {
@@ -46,12 +46,14 @@ export const CitySelector: React.FC = observer(() => {
const handleCityChange = (event: SelectChangeEvent<string>) => {
const cityId = event.target.value;
if (cityId === "") {
snapshotStore.clearStoreCache();
setSelectedCity(null);
return;
}
const city = currentCities.find((c) => c.id === Number(cityId));
if (city) {
snapshotStore.clearStoreCache();
setSelectedCity(city);
}
};