Jets de masse #391

Merged
vincent.vandeme merged 1 commits from master-improve into master 2021-03-25 07:32:17 +01:00
Showing only changes of commit e8a59b56a4 - Show all commits

View File

@ -190,10 +190,13 @@ export class RdDItemCompetence extends Item {
if (competences.length == 0) { if (competences.length == 0) {
return undefined; return undefined;
} }
const competence = competences[0]; let competence = competences.find(it => Grammar.toLowerCaseNoAccent(it.name) == name);
if (competences.length>1) { if (!competence) {
const names = competences.map(it => it.name).reduce((a, b) => `${a}<br>${b}`); competence = competences[0];
ui.notifications.info(`Plusieurs compétences possibles:<br>${names}<br>La première sera choisie: ${competence.name}`); if (competences.length>1) {
const names = competences.map(it => it.name).reduce((a, b) => `${a}<br>${b}`);
ui.notifications.info(`Plusieurs compétences possibles:<br>${names}<br>La première sera choisie: ${competence.name}`);
}
} }
return competence; return competence;
} }