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

Tag is vague and is mostly used in our code base to represent a Tag
ember object.
This commit is contained in:
Alan Guo Xiang Tan 2022-06-29 13:18:30 +08:00 committed by GitHub
parent f070ebca9d
commit 644e05cd4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -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,
});
});

View File

@ -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() {