mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-01 14:16:58 +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) {
|
if (data.location.identifier) {
|
||||||
locationUrl = locationUrl + `/${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.href = endpoint;
|
||||||
a.download = data.location.filename;
|
a.download = data.location.filename;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
|
@ -44,14 +44,14 @@ export function sortArrayByTimestampAndGroupName(array) {
|
|||||||
// Both have timestamp, sort by timestamp descending
|
// Both have timestamp, sort by timestamp descending
|
||||||
return b.timestamp - a.timestamp;
|
return b.timestamp - a.timestamp;
|
||||||
} else if (a.timestamp) {
|
} else if (a.timestamp) {
|
||||||
// Only `a` has timestamp, it comes first
|
|
||||||
return -1;
|
return -1;
|
||||||
} else if (b.timestamp) {
|
} else if (b.timestamp) {
|
||||||
// Only `b` has timestamp, it comes first
|
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
// Neither has timestamp, sort alphabetically by groupName
|
// Neither has timestamp, sort alphabetically by groupName (with fallback)
|
||||||
return a.groupName.localeCompare(b.groupName);
|
const nameA = a.groupName || '';
|
||||||
|
const nameB = b.groupName || '';
|
||||||
|
return nameA.localeCompare(nameB);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user