fix: restore localStorage filter persistence in LogisticsReadinessBoard, SW v60

This commit is contained in:
root 2026-07-03 15:04:05 +00:00
parent 468c3c4097
commit 43d9116c51
2 changed files with 6 additions and 3 deletions

View File

@ -1,8 +1,8 @@
const isLocalhost = self.location.hostname === "localhost" || self.location.hostname === "127.0.0.1";
if (!isLocalhost) {
const STATIC_CACHE = "construction-delivery-static-v59";
const RUNTIME_CACHE = "construction-delivery-runtime-v59";
const STATIC_CACHE = "construction-delivery-static-v60";
const RUNTIME_CACHE = "construction-delivery-runtime-v60";
const APP_SHELL_URLS = ["/", "/index.html", "/manifest.webmanifest", "/icons/icon-192.png", "/icons/icon-512.png"];
self.addEventListener("install", (event) => {

View File

@ -245,7 +245,10 @@ const SortableSection = ({ statusValue, label, groups, isCollapsed, onToggle, on
};
export const LogisticsReadinessBoard = ({ orderGroups = [], onSelectSet, statusOptions = ORDER_GROUP_DISPLAY_STATUS_OPTIONS, isLoading = false }) => {
const [filters, setFilters] = React.useState({ query: "", displayStatus: "all", city: "" });
const FILTERS_KEY = "logistics-filters";
const savedFilters = (() => { try { return JSON.parse(localStorage.getItem(FILTERS_KEY) || "null"); } catch { return null; } })();
const [filters, setFilters] = React.useState(savedFilters || { query: "", displayStatus: "all", city: "" });
React.useEffect(() => { try { localStorage.setItem(FILTERS_KEY, JSON.stringify(filters)); } catch {} }, [filters]);
const [collapsedSections, setCollapsedSections] = React.useState(() => loadCollapsedSections());
const [sectionOrder, setSectionOrder] = React.useState(() => {
const custom = loadCustomOrder();