Skip to content

Commit

Permalink
Fix using undefined targets in the batch script (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-castelain authored Jul 11, 2024
1 parent 3f482cd commit 2de4f92
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions assets/controllers/batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ export default class extends Controller {
#updateBatchActionBar() {
const uniqueSelectedCount = this.#getUniqueSelectedCount();

this.selectedCounterTarget.innerHTML = uniqueSelectedCount;
this.batchActionBarTarget.hidden = uniqueSelectedCount === 0;
if (this.hasSelectedCounterTarget) {
this.selectedCounterTarget.innerHTML = uniqueSelectedCount;
}
if (this.hasBatchActionBarTarget) {
this.batchActionBarTarget.hidden = uniqueSelectedCount === 0;
}
}

#updateIndeterminateStates() {
Expand Down

0 comments on commit 2de4f92

Please sign in to comment.