Skip to content

A platform for community discussion. Free, open, simple.

PERF: Re-use topic-footer-button elements when rerendering (#35167)

David Taylor00375be66588
diff --git a/app/assets/javascripts/discourse/app/components/anonymous-topic-footer-buttons.gjs b/app/assets/javascripts/discourse/app/components/anonymous-topic-footer-buttons.gjs
index 329ddbe11d1..e7a907e8add 100644
--- a/app/assets/javascripts/discourse/app/components/anonymous-topic-footer-buttons.gjs
+++ b/app/assets/javascripts/discourse/app/components/anonymous-topic-footer-buttons.gjs
@@ -30,7 +30,7 @@ export default class AnonymousTopicFooterButtons extends Component {
<template>
<div class="topic-footer-main-buttons">
- {{#each this.buttons as |button|}}
+ {{#each this.buttons key="id" as |button|}}
<DButton
@action={{button.action}}
@icon={{button.icon}}
diff --git a/app/assets/javascripts/discourse/app/components/topic-footer-buttons.gjs b/app/assets/javascripts/discourse/app/components/topic-footer-buttons.gjs
index abe03616e12..0de9f65ca5d 100644
--- a/app/assets/javascripts/discourse/app/components/topic-footer-buttons.gjs
+++ b/app/assets/javascripts/discourse/app/components/topic-footer-buttons.gjs
@@ -136,7 +136,7 @@ export default class TopicFooterButtons extends Component {
@buttonClasses="topic-footer-button"
/>
- {{#each this.inlineActionables as |actionable|}}
+ {{#each this.inlineActionables key="id" as |actionable|}}
{{#if (eq actionable.type "inline-button")}}
{{#if (eq actionable.id "bookmark")}}
<BookmarkMenu
@@ -206,7 +206,7 @@ export default class TopicFooterButtons extends Component {
</:trigger>
<:content>
<DropdownMenu as |dropdown|>
- {{#each this.dropdownButtons as |button|}}
+ {{#each this.dropdownButtons key="id" as |button|}}
<dropdown.item>
<DButton
@action={{button.action}}