Refactor: handle button data attrs the same.

A small refactor to handle `button.dataset.move` (which was assigned to a
local const) and `button.dataset.category` (which was accessed directly)
in the same way by assigning them both to local consts.
This commit is contained in:
George Brocklehurst 2025-07-19 16:36:45 +01:00
parent 7cbbb3168e
commit 7b820d4c60
No known key found for this signature in database
GPG key ID: 0C643A97B51FFCFB

View file

@ -113,10 +113,9 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
deselectMove(event) {
const button = event.target.closest('.activity-container');
const move = button.dataset.move;
this.moveData[button.dataset.category].moves[move].selected = this.moveData[button.dataset.category].moves[move]
.selected
? this.moveData[button.dataset.category].moves[move].selected - 1
const { move, category } = button.dataset;
this.moveData[category].moves[move].selected = this.moveData[category].moves[move].selected
? this.moveData[category].moves[move].selected - 1
: 0;
this.render();