Skip to content

Commit

Permalink
replace recently hashed with recently imported files (#980)
Browse files Browse the repository at this point in the history
* replace recently hashed with recently imported files in renamer add files modal

* fix queryKey
  • Loading branch information
Terrails authored Aug 13, 2024
1 parent a6df910 commit c53b225
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/Utilities/Renamer/AddFilesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ const addEntireCollection = () => {
.catch(console.error);
};

const addRecentlyHashedFiles = (pageSize: number) => {
const addRecentlyImportedFiles = (pageSize: number) => {
queryClient.fetchQuery<ListResultType<FileType>>(
{
queryKey: ['files', 'recently-hashed', pageSize],
queryFn: () => axios.get('File', { params: { pageSize, sortOrder: [-FileSortCriteriaEnum.CreatedAt] } }),
queryKey: ['files', 'recently-imported', pageSize],
queryFn: () =>
axios.get('File', {
params: { pageSize, exclude: ['Unrecognized'], sortOrder: [-FileSortCriteriaEnum.CreatedAt] },
}),
},
)
.then(result => store.dispatch(addFiles(result.List)))
Expand Down Expand Up @@ -117,7 +120,7 @@ const AddFilesModal = ({ onClose, show }: Props) => {
</Button>
</div>
<div className="flex items-center justify-between">
<div className="text-sm font-semibold">Recently Hashed Files</div>
<div className="text-sm font-semibold">Recently Imported Files</div>
<div className="flex items-center gap-x-2">
<InputSmall
id="pageSize"
Expand All @@ -127,7 +130,7 @@ const AddFilesModal = ({ onClose, show }: Props) => {
className="w-12 text-center"
/>
<Button
onClick={() => addRecentlyHashedFiles(pageSize)}
onClick={() => addRecentlyImportedFiles(pageSize)}
>
<Icon path={mdiPlayCircleOutline} size={1} className="text-panel-text-primary" />
</Button>
Expand Down

0 comments on commit c53b225

Please sign in to comment.