[dashboard] (#4515)

This commit is contained in:
Grace Guo
2018-03-01 15:48:04 -08:00
committed by GitHub
parent 79bb54a173
commit 2637d3d5e2

View File

@@ -41,8 +41,9 @@ export function getInitialState(bootstrapData) {
} else {
dashboard.position_json = [];
}
const lastRowId = Math.max.apply(null,
dashboard.position_json.map(pos => (pos.row + pos.size_y)));
const lastRowId = Math.max(0, Math.max.apply(null,
dashboard.position_json.map(pos => (pos.row + pos.size_y))));
let newSliceCounter = 0;
dashboard.slices.forEach((slice) => {
const sliceId = slice.slice_id;