Fix the uploadedAt value

This commit is contained in:
Arnaud 2025-02-07 18:03:28 +01:00
parent 6380f53e1e
commit cc066ffa40
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663
3 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ export function StorageRequestFileChooser({
};
const onSuccess = (data: string) => {
FilesUtils.setUploadedAt(data, Date.now());
FilesUtils.setUploadedAt(data, Date.now() / 1000);
queryClient.invalidateQueries({ queryKey: ["cids"] });

View File

@ -8,7 +8,7 @@ export function UploadCard() {
const queryClient = useQueryClient();
const onSuccess = (cid: string) => {
FilesUtils.setUploadedAt(cid, Date.now());
FilesUtils.setUploadedAt(cid, Date.now() / 1000);
queryClient.invalidateQueries({ queryKey: ["cids"] });
};

View File

@ -7,7 +7,7 @@ export type TimesUnit =
| "seconds";
const plural = (value: number, unit: TimesUnit) => {
const val = value.toFixed(1);
const val = Number.isInteger(value) ? value : value.toFixed(1);
return value > 1 ? val + ` ${unit}` : val + ` ${unit.slice(0, -1)}`;
};