|
@@ -1,4 +1,4 @@
|
|
|
-import React from 'react';
|
|
|
|
|
|
|
+import React, { useCallback } from 'react';
|
|
|
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
|
|
|
@@ -31,11 +31,11 @@ const EmptyTrashButton = () => {
|
|
|
pageWithMetas = injectTo(dataWithMetas);
|
|
pageWithMetas = injectTo(dataWithMetas);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const onDeletedHandler = () => {
|
|
|
|
|
|
|
+ const onDeletedHandler = useCallback(() => {
|
|
|
toastSuccess(t('empty_trash'));
|
|
toastSuccess(t('empty_trash'));
|
|
|
|
|
|
|
|
mutate();
|
|
mutate();
|
|
|
- };
|
|
|
|
|
|
|
+ }, [t, mutate]);
|
|
|
|
|
|
|
|
const emptyTrashClickHandler = () => {
|
|
const emptyTrashClickHandler = () => {
|
|
|
openDeleteModal(pageWithMetas, { onDeleted: onDeletedHandler, emptyTrash: true });
|
|
openDeleteModal(pageWithMetas, { onDeleted: onDeletedHandler, emptyTrash: true });
|