Skip to content

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

DEV: Rename variable in TagSectionLink JavaScript class (#17274)

Alan Guo Xiang Tan644e05cd4d99
diff --git a/app/assets/javascripts/discourse/app/components/sidebar/tags-section.js b/app/assets/javascripts/discourse/app/components/sidebar/tags-section.js
index d5f9ba748fb..97d085ae22d 100644
--- a/app/assets/javascripts/discourse/app/components/sidebar/tags-section.js
+++ b/app/assets/javascripts/discourse/app/components/sidebar/tags-section.js
@@ -22,7 +22,7 @@ export default class SidebarTagsSection extends GlimmerComponent {
get sectionLinks() {
return this.currentUser.trackedTags.map((trackedTag) => {
return new TagSectionLink({
- tag: trackedTag,
+ tagName: trackedTag,
topicTrackingState: this.topicTrackingState,
});
});
diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/tags-section/tag-section-link.js b/app/assets/javascripts/discourse/app/lib/sidebar/tags-section/tag-section-link.js
index cf161a1aff7..fda4b8fa290 100644
--- a/app/assets/javascripts/discourse/app/lib/sidebar/tags-section/tag-section-link.js
+++ b/app/assets/javascripts/discourse/app/lib/sidebar/tags-section/tag-section-link.js
@@ -8,8 +8,8 @@ export default class TagSectionLink {
@tracked totalUnread = 0;
@tracked totalNew = 0;
- constructor({ tag, topicTrackingState }) {
- this.tag = tag;
+ constructor({ tagName, topicTrackingState }) {
+ this.tagName = tagName;
this.topicTrackingState = topicTrackingState;
this.refreshCounts();
}
@@ -17,22 +17,22 @@ export default class TagSectionLink {
@bind
refreshCounts() {
this.totalUnread = this.topicTrackingState.countUnread({
- tagId: this.tag,
+ tagId: this.tagName,
});
if (this.totalUnread === 0) {
this.totalNew = this.topicTrackingState.countNew({
- tagId: this.tag,
+ tagId: this.tagName,
});
}
}
get name() {
- return this.tag;
+ return this.tagName;
}
get model() {
- return this.tag;
+ return this.tagName;
}
get currentWhen() {
@@ -44,7 +44,7 @@ export default class TagSectionLink {
}
get text() {
- return this.tag;
+ return this.tagName;
}
get badgeText() {