Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit ca40db2

Browse files
dlabrecqdgutride
authored andcommitted
fix(action): use lodash’s clone Vs deepClone or none at all
Instead of not cloning at all, we can use lodash’s clone function for the action component.
1 parent c46dcb1 commit ca40db2

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/app/action/action.component.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
ViewEncapsulation
1111
} from '@angular/core';
1212

13-
import { cloneDeep, defaults, has, isEqual } from 'lodash';
13+
import { clone, cloneDeep, defaults, has, isEqual } from 'lodash';
1414

1515
import { Action } from './action';
1616
import { ActionConfig } from './action-config';
@@ -84,18 +84,8 @@ export class ActionComponent implements DoCheck, OnInit {
8484
} else {
8585
this.config = cloneDeep(this.defaultConfig);
8686
}
87-
// lodash has issues cloning primaryActions.template with the list component
88-
let found = false;
89-
if (this.config.primaryActions !== undefined) {
90-
this.config.primaryActions.forEach((action) => {
91-
if (has(action, 'template')) {
92-
found = true;
93-
}
94-
});
95-
}
96-
if (!found) {
97-
this.prevConfig = cloneDeep(this.config);
98-
}
87+
// lodash has issues deep cloning templates -- best seen with list component
88+
this.prevConfig = clone(this.config);
9989
}
10090

10191
// Private

0 commit comments

Comments
 (0)