Skip to content

Commit

Permalink
works locally
Browse files Browse the repository at this point in the history
  • Loading branch information
brrusselburg committed Nov 26, 2024
1 parent 55fe36a commit c30f5ec
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions assets/javascripts/discourse/components/upcoming-events-list.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,21 @@ export default class UpcomingEventsList extends Component {
get title() {

Check failure on line 75 in assets/javascripts/discourse/components/upcoming-events-list.gjs

View workflow job for this annotation

GitHub Actions / ci / linting

Duplicate name 'title'
const titleMap = JSON.parse(this.siteSettings.map_events_title);
const categorySlug = this.router.currentRoute.attributes?.category?.slug;
const customTitleValue = titleMap.find(
const customTitleFind = titleMap.find(
(o) => o.category_slug === categorySlug
);

const title = customTitleValue
? customTitleValue.custom_title
: null;
const title = (typeof customTitleFind === "undefined") ? null : customTitleFind.custom_title;

return I18n.t("discourse_post_event.upcoming_events_list.title", {
upcoming_events_title: title,
});
if (!title) {
return I18n.t("discourse_post_event.upcoming_events_list.title", {
upcoming_events_title: "Upcoming Events",
});
} else {
return I18n.t("discourse_post_event.upcoming_events_list.title", {
upcoming_events_title: title,
});
}
}

get hasEmptyResponse() {
Expand Down

0 comments on commit c30f5ec

Please sign in to comment.