Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/models/social-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ export default ModelBase.extend({
// and non-null name is being sent from API, for some reason, for certain events,
// this throws an error, so we check first if name exists
// https://github.com/fossasia/open-event-frontend/issues/4777
return this.name && this.name.trim().toLowerCase();

let normalizedName = this.name && this.name.trim().toLowerCase();
const socialPlatforms = ['facebook', 'twitter', 'github', 'youtube', 'linkedin', 'google'];
if (normalizedName && !socialPlatforms.includes(normalizedName)) {
normalizedName = 'globe';
}
return normalizedName;
}),

isTwitter: equal('normalizedName', 'twitter'),
Expand Down