Skip to content

Commit 2d41832

Browse files
fix(TopicInfo): do not display /s when speed is undefined
1 parent 130dab2 commit 2d41832

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/utils/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ export const formatBytes = (bytes) => {
2020
return numeral(bytes).format('0 b');
2121
};
2222

23-
export const formatBps = (bytes) => formatBytes(bytes) + '/s';
23+
export const formatBps = (bytes) => {
24+
const formattedBytes = formatBytes(bytes);
25+
26+
if (!formattedBytes) {
27+
return '';
28+
}
29+
30+
return formattedBytes + '/s';
31+
};
2432

2533
export const formatBytesToGigabyte = (bytes) => {
2634
return `${Math.floor(bytes / GIGABYTE)} GB`;

0 commit comments

Comments
 (0)