This commit is contained in:
Manav Rathi
2025-07-04 19:51:16 +05:30
parent 3b273a9e7b
commit 4445ef8aef
4 changed files with 25 additions and 25 deletions

View File

@@ -123,9 +123,9 @@ export const GalleryBarAndListHeader: React.FC<
const isActiveCollectionDownloadInProgress = useCallback(() => {
const group = saveGroups.find(
(g) => g.collectionID == activeCollectionID,
(g) => g.collectionSummaryID === activeCollectionID,
);
return group && !isSaveCancelled(group) && !isSaveComplete(group);
return group && !isSaveComplete(group) && !isSaveCancelled(group);
}, [saveGroups, activeCollectionID]);
useEffect(() => {

View File

@@ -85,12 +85,12 @@ export const DownloadStatusNotifications: React.FC<
if (electron) {
electron.openDirectory(group.downloadDirPath);
} else if (onShowCollection) {
if (group.isHidden) {
if (group.isHiddenCollectionSummary) {
void onShowHiddenSection().then(() => {
onShowCollection(group.collectionID);
onShowCollection(group.collectionSummaryID);
});
} else {
onShowCollection(group.collectionID);
onShowCollection(group.collectionSummaryID);
}
} else {
return undefined;

View File

@@ -28,15 +28,15 @@ export interface SaveGroup {
*/
title: string;
/**
* If this save group is associated with a collection, then the ID of the
* collection.
* If this save group is associated with a {@link CollectionSummary}, then
* the ID of that collection summary.
*/
collectionID?: number;
collectionSummaryID?: number;
/**
* `true` if the collection associated with the save group is a hidden
* collection.
* `true` if the collection summary associated with the save group is
* hidden.
*/
isHidden?: boolean;
isHiddenCollectionSummary?: boolean;
/**
* The path to a directory on the user's file system that was selected by
* the user to save the files in when they initiated the download on the

View File

@@ -54,19 +54,19 @@ export const downloadAndSaveFiles = (
* the same name as the collection.
*/
export const downloadAndSaveCollectionFiles = async (
collectionName: string,
collectionID: number | undefined,
collectionSummaryName: string,
collectionSummaryID: number,
files: EnteFile[],
isHidden: boolean,
isHiddenCollectionSummary: boolean,
onAddSaveGroup: AddSaveGroup,
) =>
downloadAndSave(
files,
collectionName,
collectionSummaryName,
onAddSaveGroup,
collectionName,
collectionID,
isHidden,
collectionSummaryName,
collectionSummaryID,
isHiddenCollectionSummary,
);
/**
@@ -76,9 +76,9 @@ const downloadAndSave = async (
files: EnteFile[],
title: string,
onAddSaveGroup: AddSaveGroup,
collectionName?: string,
collectionID?: number,
isHidden?: boolean,
collectionSummaryName?: string,
collectionSummaryID?: number,
isHiddenCollectionSummary?: boolean,
) => {
const electron = globalThis.electron;
@@ -89,11 +89,11 @@ const downloadAndSave = async (
// The user cancelled on the directory selection dialog.
return;
}
if (collectionName) {
if (collectionSummaryName) {
downloadDirPath = await mkdirCollectionDownloadFolder(
electron,
downloadDirPath,
collectionName,
collectionSummaryName,
);
}
}
@@ -103,8 +103,8 @@ const downloadAndSave = async (
const updateSaveGroup = onAddSaveGroup({
title,
collectionID,
isHidden,
collectionSummaryID,
isHiddenCollectionSummary,
downloadDirPath,
total,
canceller,