Could fix the issue by making onDiceConnected a no-op if the die already has a dice-wrapper, or by clearing all of the children of the dice-wrapper. Since there is already logic in getDiceHtmlEl to check if the dice-wrapper element exists I thought it would be better to clear the elements instead of duplicating/refactoring the logic.
Could fix the issue by making
onDiceConnected
a no-op if the die already has a dice-wrapper, or by clearing all of the children of the dice-wrapper. Since there is already logic ingetDiceHtmlEl
to check if the dice-wrapper element exists I thought it would be better to clear the elements instead of duplicating/refactoring the logic.