Jets de masse #391
@ -190,11 +190,14 @@ 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 (!competence) {
|
||||||
|
competence = competences[0];
|
||||||
if (competences.length>1) {
|
if (competences.length>1) {
|
||||||
const names = competences.map(it => it.name).reduce((a, b) => `${a}<br>${b}`);
|
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}`);
|
ui.notifications.info(`Plusieurs compétences possibles:<br>${names}<br>La première sera choisie: ${competence.name}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return competence;
|
return competence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user