Skip to content

Commit

Permalink
Merge pull request #54 from bullhorn/f/handleFieldNameFields
Browse files Browse the repository at this point in the history
fix(meta): handle not overwriting this.fields if you have a field named `fields`
  • Loading branch information
nickle799 authored Apr 29, 2020
2 parents ce860da + de826c8 commit 1d1f626
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/services/MetaService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ export class MetaService {
}
if (result && result.fields) {
for (const field of result.fields) {
if (!this.memory.hasOwnProperty(field.name)) {
if (
!this.memory.hasOwnProperty(field.name)
&& !['label', 'http', 'memory', 'fields', 'layouts', 'tracks', 'sectionHeaders', 'trackTrigger', 'allFieldsLoaded', 'parameters'].includes(field.name)
) {
Object.defineProperty(this, field.name, {
get() {
return this.memory[field.name];
Expand Down

0 comments on commit 1d1f626

Please sign in to comment.