removeChatMessageId support undefined

Simplifie le code de l'appelant

préparation pour enchantement de potions
This commit is contained in:
Vincent Vandemeulebrouck 2021-06-01 00:10:02 +02:00
parent cc2277c9b7
commit e13750ea68
2 changed files with 4 additions and 5 deletions

View File

@ -40,7 +40,9 @@ export class ChatUtility {
} }
static removeChatMessageId(messageId) { static removeChatMessageId(messageId) {
ChatUtility.removeMessages({ messageId: messageId }); if (messageId){
ChatUtility.removeMessages({ messageId: messageId });
}
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -614,10 +614,7 @@ export class RdDUtility {
let actor = RdDUtility.getSelectedActor("Pour effectuer le paiement:"); let actor = RdDUtility.getSelectedActor("Pour effectuer le paiement:");
if (actor) { if (actor) {
actor.depenserDeniers(sumdenier, objData, quantite, fromActorId); actor.depenserDeniers(sumdenier, objData, quantite, fromActorId);
let chatMessageId = RdDUtility.findChatMessageId(event.currentTarget); ChatUtility.removeChatMessageId(RdDUtility.findChatMessageId(event.currentTarget));
if (chatMessageId) {
ChatUtility.removeChatMessageId(chatMessageId);
}
} }
}); });
} }