diff --git a/src/components/DeleteDialog.jsx b/src/components/DeleteDialog.jsx index ee435297..421b2f15 100644 --- a/src/components/DeleteDialog.jsx +++ b/src/components/DeleteDialog.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { useDispatch, useSelector } from 'react-redux'; +import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { moveToTrashBatch } from '../store/actions/files'; import { scopes } from '../store/actions/loading'; @@ -31,7 +31,7 @@ function DeleteDialog({ uid }) { const loading = useSelector((state) => getLoading(state, scopes.movingToTrash)); const fileIds = dialogProps.fileIds ?? []; - const files = useSelector((state) => getFilesByIds(state, fileIds)); + const files = useSelector((state) => getFilesByIds(state, { ids: fileIds }), shallowEqual); const onDelete = () => { dispatch(moveToTrashBatch(files.map((file) => file.path))); diff --git a/src/components/DeleteImmediatelyDialog.jsx b/src/components/DeleteImmediatelyDialog.jsx index 5a8a9269..32960485 100644 --- a/src/components/DeleteImmediatelyDialog.jsx +++ b/src/components/DeleteImmediatelyDialog.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { useDispatch, useSelector } from 'react-redux'; +import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { deleteImmediatelyBatch } from '../store/actions/files'; import { scopes } from '../store/actions/loading'; @@ -31,7 +31,7 @@ function DeleteDialog({ uid }) { const loading = useSelector((state) => getLoading(state, scopes.deletingFileImmediately)); const fileIds = dialogProps.fileIds ?? []; - const files = useSelector((state) => getFilesByIds(state, fileIds)); + const files = useSelector((state) => getFilesByIds(state, { ids: fileIds }), shallowEqual); const onDelete = () => { dispatch(deleteImmediatelyBatch(files.map((file) => file.path))); diff --git a/src/components/FileTableView.jsx b/src/components/FileTableView.jsx index 9866e9f3..cea5caed 100644 --- a/src/components/FileTableView.jsx +++ b/src/components/FileTableView.jsx @@ -63,7 +63,8 @@ function Table({