Fix trads refresh

Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2020-07-08 17:29:35 +02:00
parent f2d449a965
commit b62cb702d1
2 changed files with 14 additions and 6 deletions

View File

@ -69,7 +69,7 @@ const Header = () => {
toggleWarningCancel(); toggleWarningCancel();
}, },
color: 'cancel', color: 'cancel',
label: formatMessageRef.current({ label: formatMessage({
id: `${pluginId}.containers.Edit.reset`, id: `${pluginId}.containers.Edit.reset`,
}), }),
type: 'button', type: 'button',
@ -82,7 +82,7 @@ const Header = () => {
{ {
disabled: !didChangeData, disabled: !didChangeData,
color: 'success', color: 'success',
label: formatMessageRef.current({ label: formatMessage({
id: `${pluginId}.containers.Edit.submit`, id: `${pluginId}.containers.Edit.submit`,
}), }),
isLoading: isSubmitting, isLoading: isSubmitting,
@ -97,7 +97,7 @@ const Header = () => {
if (!isCreatingEntry && canDelete) { if (!isCreatingEntry && canDelete) {
headerActions.unshift({ headerActions.unshift({
label: formatMessageRef.current({ label: formatMessage({
id: 'app.utils.delete', id: 'app.utils.delete',
}), }),
color: 'delete', color: 'delete',
@ -114,7 +114,15 @@ const Header = () => {
} }
return headerActions; return headerActions;
}, [canCreate, canDelete, canUpdate, didChangeData, isCreatingEntry, isSubmitting]); }, [
canCreate,
canDelete,
canUpdate,
didChangeData,
isCreatingEntry,
isSubmitting,
formatMessage,
]);
const headerProps = useMemo(() => { const headerProps = useMemo(() => {
return { return {

View File

@ -463,7 +463,7 @@ function ListView({
]; ];
}, },
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
[label, pathname, search, canCreate] [label, pathname, search, canCreate, formatMessage]
); );
const headerProps = useMemo(() => { const headerProps = useMemo(() => {
@ -487,7 +487,7 @@ function ListView({
}; };
/* eslint-enable indent */ /* eslint-enable indent */
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [count, headerAction, label, canRead]); }, [count, headerAction, label, canRead, formatMessage]);
return ( return (
<> <>