Merged in feature/IO-3373-Dashboard-Component-Redux-Fix (pull request #2618)

IO-3373 Remove Cache Eviction

Approved-by: Dave Richer
This commit is contained in:
Allan Carr
2025-10-07 18:40:51 +00:00
committed by Dave Richer

View File

@@ -1,5 +1,5 @@
import Icon, { SyncOutlined } from "@ant-design/icons";
import { useMutation, useQuery, useApolloClient } from "@apollo/client";
import { useMutation, useQuery } from "@apollo/client";
import { Button, Dropdown, Space } from "antd";
import { PageHeader } from "@ant-design/pro-layout";
import { useMemo, useState, useEffect } from "react";
@@ -33,7 +33,6 @@ const mapDispatchToProps = () => ({
export function DashboardGridComponent({ currentUser }) {
const { t } = useTranslation();
const client = useApolloClient();
const notification = useNotification();
// Constants for layout defaults
@@ -114,11 +113,6 @@ export function DashboardGridComponent({ currentUser }) {
return false;
}
// Note: Removed Apollo cache update to prevent triggering unwanted Redux actions
// Instead, evict the dashboard bodyshop query from cache to ensure fresh data on next fetch
client.cache.evict({ fieldName: "dashboard_bodyshops" });
client.cache.gc();
return true;
} catch (err) {
console.error(`Dashboard ${errorContext} failed`, err);