[dashboard] (#4515)

This commit is contained in:
Grace Guo 2018-03-01 15:48:04 -08:00 committed by GitHub
parent 79bb54a173
commit 2637d3d5e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

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;