mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-02 22:17:45 +00:00
Refactor selectItsMe and removeEntity to improve type annotations and code readability in PickEntity.vue
This commit is contained in:
parent
d8bd9bd7cd
commit
15d26d4b06
@ -167,9 +167,13 @@ const listClasses = computed(() => ({
|
|||||||
inline: true,
|
inline: true,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const selectItsMe = (event: InputEvent) => {
|
const selectItsMe = (event: InputEvent): void => {
|
||||||
const target = event.target as HTMLInputElement;
|
const target = event.target as HTMLInputElement;
|
||||||
target.checked ? addNewSuggested("me") : removeEntity("me");
|
if (target.checked) {
|
||||||
|
addNewSuggested("me");
|
||||||
|
} else {
|
||||||
|
removeEntity("me");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function addNewSuggested(entity: EntitiesOrMe) {
|
function addNewSuggested(entity: EntitiesOrMe) {
|
||||||
@ -185,7 +189,7 @@ function addNewEntity({ selected }: addNewEntities) {
|
|||||||
emits("addNewEntityProcessEnded");
|
emits("addNewEntityProcessEnded");
|
||||||
}
|
}
|
||||||
|
|
||||||
const removeEntity = (entity: EntitiesOrMe) => {
|
const removeEntity = (entity: EntitiesOrMe): void => {
|
||||||
if (!props.removableIfSet) return;
|
if (!props.removableIfSet) return;
|
||||||
if (entity === "me" && itsMeCheckbox.value) {
|
if (entity === "me" && itsMeCheckbox.value) {
|
||||||
itsMeCheckbox.value.checked = false;
|
itsMeCheckbox.value.checked = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user