Skip to content

Commit c9442e4

Browse files
committed
fix: show globe icon for general web links
1 parent d43df1b commit c9442e4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/models/social-link.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ export default ModelBase.extend({
1717
// and non-null name is being sent from API, for some reason, for certain events,
1818
// this throws an error, so we check first if name exists
1919
// https://github.com/fossasia/open-event-frontend/issues/4777
20-
return this.name && this.name.trim().toLowerCase();
20+
21+
let normalizedName = this.name && this.name.trim().toLowerCase();
22+
const socialPlatforms = ['facebook', 'twitter', 'github', 'youtube', 'linkedin', 'google'];
23+
if (normalizedName && !socialPlatforms.includes(normalizedName)) {
24+
normalizedName = 'globe';
25+
}
26+
return normalizedName;
2127
}),
2228

2329
isTwitter: equal('normalizedName', 'twitter'),

0 commit comments

Comments
 (0)