Translations - FIX - views not being refreshed on locale change (#14207)
as per title
This commit is contained in:
+5
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user