Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>
return "(none)";
};
-export const formatFileSize = (size?: number) => {
+export const formatFileSize = (size?: number | string) => {
if (typeof size === "number") {
if (size === 0) { return "0 B"; }
return `${(size / base).toFixed()} ${unit}`;
}
}
+ }
+ if ((typeof size === "string" && size === '') || size === undefined) {
+ return '';
}
return "0 B";
};
export const ResourceFileSize = connect(
(state: RootState, props: { uuid: string }) => {
const resource = getResource<CollectionResource>(props.uuid)(state.resources);
+
+ if (resource && resource.kind === ResourceKind.COLLECTION) {
+ return { fileSize: '' };
+ }
+
return { fileSize: resource ? resource.fileSizeTotal : 0 };
})((props: { fileSize?: number }) => renderFileSize(props.fileSize));