Skip to content

Commit

Permalink
Update web/client/reducers/widgets.js
Browse files Browse the repository at this point in the history
Co-authored-by: Lorenzo Natali <[email protected]>
  • Loading branch information
MV88 and offtherailz authored Nov 7, 2023
1 parent 3a07a58 commit e845799
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions web/client/reducers/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,8 @@ function widgetsReducer(state = emptyState, action) {
if (widget.widgetType === 'chart') {
widget = omit(widget, ["layer", "url"]);
}
let w = 1;
let h = 1;
if (!isEmpty(state?.defaults?.mdSize)) {
w = w * state?.defaults?.mdSize.w;
h = h * state?.defaults?.mdSize.h;
}
const w = state?.defaults?.initialSize?.w ?? 1;
const h = state?.defaults?.initialSize?.h ?? 1;
return arrayUpsert(`containers[${action.target}].widgets`, {
id: action.id,
...widget,
Expand Down

0 comments on commit e845799

Please sign in to comment.