@provoly/dashboard 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12203,7 +12203,7 @@ class DashboardEffects {
12203
12203
  // Creating new current window manifest, without moved widget
12204
12204
  const myNewWindow = {
12205
12205
  ...newWindows[rank],
12206
- widgets: [...newWindows[rank].widgets]
12206
+ widgets: [...(newWindows[rank] ?? { widgets: [] }).widgets]
12207
12207
  };
12208
12208
  const widget = myNewWindow.widgets.splice(action.widgetIndex, 1)[0];
12209
12209
  newWindows[rank] = myNewWindow;
@@ -12221,7 +12221,7 @@ class DashboardEffects {
12221
12221
  // Try to find a spot in windows (starting by current rank, then in others)
12222
12222
  const sequence = WidgetPlacementUtils.swapArrayElements(new Array(manifestGlobal.windows.length).fill(0).map((_, idx, array) => idx), 0, rank);
12223
12223
  // Trying all placement options in target window
12224
- const windowLayout = manifestGlobal.windows[targetRank].grid?.layout ?? DashboardGridLayout.MANUAL;
12224
+ const windowLayout = (manifestGlobal.windows[targetRank] ?? {}).grid?.layout ?? DashboardGridLayout.MANUAL;
12225
12225
  if (windowLayout !== DashboardGridLayout.MANUAL) {
12226
12226
  const options = WidgetPlacementUtils.placementOptions(widget, windowLayout);
12227
12227
  if (!found) {
@@ -12248,7 +12248,7 @@ class DashboardEffects {
12248
12248
  newWindows[placeWeFound.actualRank].widgets.push(placeWeFound.widget);
12249
12249
  }
12250
12250
  else {
12251
- const currentWindowLayout = manifestGlobal.windows[rank].grid?.layout ?? DashboardGridLayout.FULL;
12251
+ const currentWindowLayout = (manifestGlobal.windows[rank] ?? {}).grid?.layout ?? DashboardGridLayout.FULL;
12252
12252
  // si non trouvé : nouvelle page, première position suggérée
12253
12253
  const firstProposedLayout = WidgetPlacementUtils.placementOptions(widget, currentWindowLayout)[0];
12254
12254
  newWindows.push({ widgets: [firstProposedLayout ?? widget], grid: { layout: currentWindowLayout } });