mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-05-31 05:36:59 +00:00
save_file update
This commit is contained in:
parent
ac508112d1
commit
69c9959a87
@ -1949,7 +1949,10 @@ export const saveFile = async (data, sender, isFromExtension, snackMethods) => {
|
||||
if (data.location.identifier) {
|
||||
locationUrl = locationUrl + `/${data.location.identifier}`;
|
||||
}
|
||||
const endpoint = await createEndpoint(locationUrl);
|
||||
const endpoint = await createEndpoint(
|
||||
locationUrl +
|
||||
`?attachment=true&attachmentFilename=${data?.location?.filename}`
|
||||
);
|
||||
a.href = endpoint;
|
||||
a.download = data.location.filename;
|
||||
document.body.appendChild(a);
|
||||
|
@ -44,14 +44,14 @@ export function sortArrayByTimestampAndGroupName(array) {
|
||||
// Both have timestamp, sort by timestamp descending
|
||||
return b.timestamp - a.timestamp;
|
||||
} else if (a.timestamp) {
|
||||
// Only `a` has timestamp, it comes first
|
||||
return -1;
|
||||
} else if (b.timestamp) {
|
||||
// Only `b` has timestamp, it comes first
|
||||
return 1;
|
||||
} else {
|
||||
// Neither has timestamp, sort alphabetically by groupName
|
||||
return a.groupName.localeCompare(b.groupName);
|
||||
// Neither has timestamp, sort alphabetically by groupName (with fallback)
|
||||
const nameA = a.groupName || '';
|
||||
const nameB = b.groupName || '';
|
||||
return nameA.localeCompare(nameB);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user