ParticulaCode / GoDiceJavaScriptAPI

GoDice JavaScript API (with demo)
Other
54 stars 20 forks source link

Fixing duplicate dice-wrapper elements on same die connect #6

Closed W0NDERBREAD closed 2 years ago

W0NDERBREAD commented 2 years ago

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.