feat: update map, admin to and cache
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user