mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +08:00
fix(frontend): add missing i18n keys and improve workspace switch cache invalidation
- Add common.status.ready i18n key for zh/en locales - Add ready/initialized/archived/failed status colors to dashboard widgets - Expand QueryInvalidator to invalidate projectOverview, workflowStatusCounts, and dashboardStats queries on workspace switch
This commit is contained in:
@@ -53,13 +53,18 @@ function QueryInvalidator() {
|
||||
const registerQueryInvalidator = useWorkflowStore((state) => state.registerQueryInvalidator);
|
||||
|
||||
useEffect(() => {
|
||||
// Register callback to invalidate all 'workspace' prefixed queries
|
||||
// Register callback to invalidate all workspace-related queries on workspace switch
|
||||
const callback = () => {
|
||||
queryClient.invalidateQueries({
|
||||
predicate: (query) => {
|
||||
const queryKey = query.queryKey;
|
||||
// Check if the first element of the query key is 'workspace'
|
||||
return Array.isArray(queryKey) && queryKey[0] === 'workspace';
|
||||
if (!Array.isArray(queryKey)) return false;
|
||||
const prefix = queryKey[0];
|
||||
// Invalidate all query families that depend on workspace data
|
||||
return prefix === 'workspace'
|
||||
|| prefix === 'projectOverview'
|
||||
|| prefix === 'workflowStatusCounts'
|
||||
|| prefix === 'dashboardStats';
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user