Translations - FIX - views not being refreshed on locale change (#14207)

as per title
This commit is contained in:
nitin
2025-09-02 17:30:40 +05:30
committed by GitHub
parent ce3fcb295d
commit c4f56156d6
9 changed files with 88 additions and 22 deletions
@@ -9,6 +9,7 @@ import {
import { UPDATE_ONE_OBJECT_METADATA_ITEM } from '../graphql/mutations';
import { useRefreshObjectMetadataItems } from '@/object-metadata/hooks/useRefreshObjectMetadataItems';
import { useRefreshCoreViewsByObjectMetadataId } from '@/views/hooks/useRefreshCoreViewsByObjectMetadataId';
// TODO: Slice the Apollo store synchronously in the update function instead of subscribing, so we can use update after read in the same function call
export const useUpdateOneObjectMetadataItem = () => {
@@ -20,6 +21,9 @@ export const useUpdateOneObjectMetadataItem = () => {
const { refreshObjectMetadataItems } =
useRefreshObjectMetadataItems('network-only');
const { refreshCoreViewsByObjectMetadataId } =
useRefreshCoreViewsByObjectMetadataId();
const updateOneObjectMetadataItem = async ({
idToUpdate,
updatePayload,
@@ -35,6 +39,7 @@ export const useUpdateOneObjectMetadataItem = () => {
});
await refreshObjectMetadataItems();
await refreshCoreViewsByObjectMetadataId(idToUpdate);
return result;
};