Skip to content

Commit

Permalink
check for widget before setting it
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiggr committed Nov 8, 2022
1 parent 036d4ca commit 561505f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ export {
export installDemo from './demo';

const applyConfig = (config) => {
config.widgets.widget.object_list_popup = ObjectListWidget;
config.widgets.widget.object_list_inline = ObjectListInlineWidget;
config.widgets.widget.object_by_type = ObjectByTypeWidget;
config.widgets.widget.option_mapping = MappingWidget;
config.widgets.widget.attachedimage = AttachedImageWidget;
if (config.widgets?.widget) {
config.widgets.widget.object_list_popup = ObjectListWidget;
config.widgets.widget.object_list_inline = ObjectListInlineWidget;
config.widgets.widget.object_by_type = ObjectByTypeWidget;
config.widgets.widget.option_mapping = MappingWidget;
config.widgets.widget.attachedimage = AttachedImageWidget;
}

return config;
};
Expand Down

0 comments on commit 561505f

Please sign in to comment.