pcm-shared-components 0.0.99 → 0.0.102

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.
@@ -98,11 +98,13 @@ export const GenericDialogWindow = props => {
98
98
  try {
99
99
  //Loop over all our on click overrides and apply the onClick callback for each id found in the onClickOverride state
100
100
  onClickOverride.forEach(item => {
101
- setManagedAppBarMenu(previousState => {
102
- return { ...previousState,
103
- mainMenu: updateObjectByID(previousState.mainMenu, item.id, item.onClick)
104
- };
105
- });
101
+ if (item && item.id) {
102
+ setManagedAppBarMenu(previousState => {
103
+ return { ...previousState,
104
+ mainMenu: updateObjectByID(previousState.mainMenu, item.id, item.onClick)
105
+ };
106
+ });
107
+ }
106
108
  });
107
109
  } catch (error) {
108
110
  console.error('Error in setMenuOnClickCallback: ', error);
@@ -114,10 +116,10 @@ export const GenericDialogWindow = props => {
114
116
  setOverrides();
115
117
  }, [onClickOverride]);
116
118
  useEffect(() => {
117
- if (appBarMenu && appBarMenu.mainMenu) {
119
+ if (appBarMenu && appBarMenu.mainMenu && appBarMenu.mainMenu.length > 0) {
118
120
  setManagedAppBarMenu({ ...appBarMenu,
119
121
  mainMenu: [...appBarMenu.mainMenu.map(mm => {
120
- if (mm.id === 'save') {
122
+ if (mm.id && mm.id === 'save') {
121
123
  return { ...mm,
122
124
  onClick: onSave,
123
125
  name: save_button_label ? save_button_label : mm.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pcm-shared-components",
3
- "version": "0.0.99",
3
+ "version": "0.0.102",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "babel": {