Skip to content

Commit 16af51d

Browse files
committed
fix formatting in downloadFile
added filename back into sort for unattached files
1 parent 449c585 commit 16af51d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/main/downloadFile.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const downloadFile = (
5656
out.destroy();
5757
if (key) {
5858
const status = downloadMap.get(key);
59-
downloadMap.set(key, status? { ...status, error }: { error })
59+
downloadMap.set(key, status ? { ...status, error } : { error });
6060
}
6161
reject(error);
6262
return;
@@ -76,9 +76,12 @@ export const downloadFile = (
7676
received_bytes += chunk.length;
7777
if (key) {
7878
const status = downloadMap.get(key);
79-
downloadMap.set(key, status
80-
? { ...status, received: received_bytes }
81-
: { received: received_bytes });
79+
downloadMap.set(
80+
key,
81+
status
82+
? { ...status, received: received_bytes }
83+
: { received: received_bytes }
84+
);
8285
}
8386
});
8487

@@ -94,7 +97,7 @@ export const downloadFile = (
9497
out.destroy();
9598
if (key) {
9699
const status = downloadMap.get(key);
97-
downloadMap.set(key, status? { ...status, error }: { error });
100+
downloadMap.set(key, status ? { ...status, error } : { error });
98101
}
99102
reject(error);
100103
});
@@ -119,7 +122,7 @@ export const downloadFile = (
119122
req.destroy();
120123
if (key) {
121124
const status = downloadMap.get(key);
122-
downloadMap.set(key, status? { ...status, error }: { error });
125+
downloadMap.set(key, status ? { ...status, error } : { error });
123126
}
124127
reject(error);
125128
});

src/renderer/src/components/AudioTab/AudioTable.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,16 @@ export const AudioTable = (props: IProps) => {
9595
const waitForRemoteQueue = useWaitForRemoteQueue();
9696
const boxRef = useRef<HTMLDivElement>(null);
9797
const [addWidth, setAddWidth] = useState(0);
98+
//we are mixing manual and automatic sorting to provide multi column sort as the initial data but the user can manually sort by one column.
9899
const [sortedData, setSortedData] = useState<IRow[]>([]);
99100
const [sortModel, setSortModel] = useState<GridSortModel>([]);
100101
useEffect(() => {
101102
const sm = onAttach
102103
? [
103104
{ field: 'planName', sort: 'asc' },
104-
{ field: 'sectionDesc', sort: 'asc' },
105+
{ field: 'sectionDesc', sort: 'asc' }, //for attached files
105106
{ field: 'reference', sort: 'asc' },
107+
{ field: 'fileName', sort: 'asc' }, //for unattached files
106108
{ field: 'date', sort: 'desc' },
107109
]
108110
: [{ field: 'version', sort: 'desc' }];

0 commit comments

Comments
 (0)