Skip to content

Commit

Permalink
fix: fix undefined error in widget-migration-helper (#4898)
Browse files Browse the repository at this point in the history
Signed-off-by: yuda110 <[email protected]>
  • Loading branch information
yuda110 authored Oct 23, 2024
1 parent 83f1a32 commit 44ac94e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ const handleCloneWidget = async (widget: RefinedWidgetInfo) => {
options: {
...widget.options,
widgetHeader: {
...(widget.options.widgetHeader as WidgetHeaderValue ?? {}),
...(widget.options?.widgetHeader as WidgetHeaderValue ?? {}),
title: widget.options?.widgetHeader?.title ? `Clone - ${widget.options.widgetHeader.title}` : undefined,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ const migrateTable = (widget: PublicWidgetModel|PrivateWidgetModel): PublicWidge
const migrateAllWidgets = (dashboardWidgets: Array<PublicWidgetModel|PrivateWidgetModel>): Array<PublicWidgetModel|PrivateWidgetModel> => {
const _migratedWidgets: Array<PublicWidgetModel|PrivateWidgetModel> = cloneDeep(dashboardWidgets);
_migratedWidgets.forEach((widget) => {
const _widgetOptions: WidgetOptions = cloneDeep(widget.options);
const _widgetHeaderOption = cloneDeep(widget.options.widgetHeader) as WidgetHeaderValue;
const _widgetOptions: WidgetOptions = cloneDeep(widget?.options);
const _widgetHeaderOption = cloneDeep(widget?.options?.widgetHeader) as WidgetHeaderValue;
if (_widgetHeaderOption && (_widgetHeaderOption?.toggleValue === undefined)) {
widget.options = {
..._widgetOptions,
Expand Down

0 comments on commit 44ac94e

Please sign in to comment.