Pull out .#isBoosted() in rollup-controller
This commit is contained in:
@@ -8,7 +8,7 @@ export default class extends Controller {
|
||||
}
|
||||
|
||||
#summarizeBoosts() {
|
||||
if (this.hasBoostEventTarget) {
|
||||
if (this.#isBoosted) {
|
||||
const el = document.createElement("span")
|
||||
el.dataset.turboTemporary = ""
|
||||
el.textContent = this.#boostSumaries.toSentence()
|
||||
@@ -16,6 +16,10 @@ export default class extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
get #isBoosted() {
|
||||
return this.hasBoostEventTarget
|
||||
}
|
||||
|
||||
get #boostSumaries() {
|
||||
return Object.entries(this.#boostsByCreator).map(([_creatorId, boostEvents]) => {
|
||||
return `${boostEvents[0].dataset.creatorName} +${boostEvents.length}`
|
||||
|
||||
Reference in New Issue
Block a user