fix: colorPrimary cache cleared

This commit is contained in:
jialin
2026-05-24 10:51:44 +08:00
committed by jialin
parent 052d5aa474
commit dc69e51042
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -1,4 +1,4 @@
import { TABLE_SORT_DIRECTIONS } from '@/config/settings';
import { PaginationKey, TABLE_SORT_DIRECTIONS } from '@/config/settings';
import useSetChunkRequest, {
createAxiosToken
} from '@/hooks/use-chunk-request';
@@ -8,7 +8,6 @@ import { handleBatchRequest } from '@/utils';
import _ from 'lodash';
import qs from 'query-string';
import { useEffect, useRef, useState } from 'react';
import { PaginationKey } from '../config/settings';
import { usePaginationStatus } from './use-pagination-status';
import { useTableMultiSort } from './use-table-sort';
@@ -265,6 +264,7 @@ export default function useTableFetch<T>(
url: `${API}?${qs.stringify(_.pickBy(query, (val: any) => !!val))}`,
handler: updateHandler
});
// eslint-disable-next-line react-hooks/purity
triggerAtRef.current = Date.now();
} catch (error) {
// ignore
@@ -361,6 +361,9 @@ export default function useTableFetch<T>(
...modalRef.current?.configuration
});
// remove the deleted id from selected ids in row selection
rowSelection.removeSelectedKeys([row.id]);
// ======== to avoid fetch data twice, because of debounceFetchData has been run =======
if (!updateManually) {
fetchData();
+1 -1
View File
@@ -358,7 +358,7 @@ export default (props: any) => {
config={{
apiBaseUrl: GPUSTACK_API_BASE_URL,
theme: userSettings.theme,
iconUrl: '//at.alicdn.com/t/c/font_4613488_acsxe9xvhd.js',
iconUrl: '//at.alicdn.com/t/c/font_4613488_13sztx8tdru.js',
isDarkTheme: userSettings.isDarkTheme,
defaultColorPrimary: COLOR_PRIMARY
}}