Skip to content

Commit

Permalink
null safe
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Nov 14, 2024
1 parent bdd667b commit 4e9e1d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/CippTable/CIPPTableToptoolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const CIPPTableToptoolbar = ({
const resetToDefaultVisibility = () => {
settings.handleUpdate({
columnDefaults: {
...settings.columnDefaults,
...settings?.columnDefaults,
[pageName]: false,
},
});
Expand All @@ -62,14 +62,14 @@ export const CIPPTableToptoolbar = ({

const resetToPreferedVisibility = () => {
if (settings?.columnDefaults[pageName]) {
setColumnVisibility(settings.columnDefaults[pageName]);
setColumnVisibility(settings?.columnDefaults[pageName]);
}
};

const saveAsPreferedColumns = () => {
settings.handleUpdate({
columnDefaults: {
...settings.columnDefaults,
...settings?.columnDefaults,
[pageName]: columnVisibility,
},
});
Expand Down

0 comments on commit 4e9e1d2

Please sign in to comment.