Skip to content

Commit

Permalink
[mgt-tasks] adding isEqual if picker chosen people aren't different n…
Browse files Browse the repository at this point in the history
…ot to update
  • Loading branch information
vogtn committed Nov 1, 2019
1 parent 933c4bc commit 240d371
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/mgt-tasks/mgt-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,21 @@ export class MgtTasks extends MgtTemplatedComponent {
}
}

const newPeopleIds = people.map(person => {
return person.id;
});

// new people from people picker
// tslint:disable-next-line: prefer-const
const isEqual =
newPeopleIds.length === savedSelectedPeople.length &&
newPeopleIds.sort().every((value, index) => {
return value === savedSelectedPeople.sort()[index];
});

if (isEqual) {
return;
}

if (people.length === 0) {
// tslint:disable-next-line: prefer-for-of
Expand Down

0 comments on commit 240d371

Please sign in to comment.