summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-11-06 00:54:02 +0900
committerJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-11-06 00:54:02 +0900
commitc4f901868246a45e3f28c725fc87b3d6c8978a47 (patch)
tree2f56bffb4c53d93f825ad6e7a77dfb37a9a3cb94
parent81b71db4fd878942283aa9150421f1ac908c7ae9 (diff)
Have always at least one skeleton
-rw-r--r--src/App.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/App.js b/src/App.js
index 838e5f3..a79456a 100644
--- a/src/App.js
+++ b/src/App.js
@@ -225,7 +225,7 @@ function StoreList(props) {
var extra = [];
for (var i = 0; i < cols - (props.data.length % cols); i += 1) extra.push({key: i});
var skeletons = [];
- for (var i2 = 0; props.loading && i2 < cols * (Math.floor(height / 240)) - cols * 2; i2 += 1) skeletons.push({key: i2});
+ for (var i2 = 0; props.loading && i2 < Math.max(cols * (Math.floor(height / 240)) - cols * 2, 1); i2 += 1) skeletons.push({key: i2});
return (
<div className={props.className} style={{ paddingLeft: cols > 1 ? 18 : 4, paddingRight: cols > 1 ? 18 : 4 }}>