Skip to content

Commit

Permalink
utilisation askConfirm
Browse files Browse the repository at this point in the history
  • Loading branch information
Kedrihan committed Jul 30, 2024
1 parent eec3423 commit 6f1d032
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -592,12 +592,11 @@ export class HousingPropertyZoneProvider {

return;
}
const value = await this.inputService.askInput({
title: 'Voulez-vous vraiment expulser votre colocataire ? (Tapez "oui" pour confirmer)',
maxCharacters: 3,
});
const confirm = await this.inputService.askConfirm(
'Voulez-vous vraiment expulser votre colocataire ? Entrez OUI pour confirmer.'
);

if (value && value.toLowerCase() === 'oui') {
if (confirm) {
await this.housingMenuProvider.removeRoommate({ apartmentId: apartments[0].id, propertyId: property.id });
}
}
Expand Down Expand Up @@ -640,12 +639,11 @@ export class HousingPropertyZoneProvider {
if (!apartment) {
return;
}
const value = await this.inputService.askInput({
title: 'Voulez-vous vraiment partir de la colocation ? (Tapez "oui" pour confirmer)',
maxCharacters: 3,
});
const confirm = await this.inputService.askConfirm(
'Voulez-vous vraiment quitter la colocation ? Entrez OUI pour confirmer.'
);

if (value && value.toLowerCase() === 'oui') {
if (confirm) {
TriggerServerEvent(ServerEvent.HOUSING_REMOVE_ROOMMATE, property.id, apartment.id);
}
}
Expand Down

0 comments on commit 6f1d032

Please sign in to comment.