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:
@@ -1,5 +1,5 @@
|
|||||||
import Icon, { SyncOutlined } from "@ant-design/icons";
|
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 { Button, Dropdown, Space } from "antd";
|
||||||
import { PageHeader } from "@ant-design/pro-layout";
|
import { PageHeader } from "@ant-design/pro-layout";
|
||||||
import { useMemo, useState, useEffect } from "react";
|
import { useMemo, useState, useEffect } from "react";
|
||||||
@@ -33,7 +33,6 @@ const mapDispatchToProps = () => ({
|
|||||||
|
|
||||||
export function DashboardGridComponent({ currentUser }) {
|
export function DashboardGridComponent({ currentUser }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const client = useApolloClient();
|
|
||||||
const notification = useNotification();
|
const notification = useNotification();
|
||||||
|
|
||||||
// Constants for layout defaults
|
// Constants for layout defaults
|
||||||
@@ -114,11 +113,6 @@ export function DashboardGridComponent({ currentUser }) {
|
|||||||
return false;
|
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;
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(`Dashboard ${errorContext} failed`, err);
|
console.error(`Dashboard ${errorContext} failed`, err);
|
||||||
|
|||||||
Reference in New Issue
Block a user