Support multiple names for the same service (#344)

This commit is contained in:
Vishnu Mohandas 2023-11-13 16:42:08 +05:30 committed by GitHub
commit c359775ebc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View file

@ -97,11 +97,7 @@
},
{
"title": "Mastodon",
"slug": "mastodon",
"hex": "6364FF"
},
{
"title": "mstdn",
"altNames": ["mstdn", "fediscience", "mathstodon", "fosstodon"],
"slug": "mastodon",
"hex": "6364FF"
},

View file

@ -93,6 +93,14 @@ class IconUtils {
icon["slug"],
icon["hex"],
);
if (icon["altNames"] != null) {
for (final name in icon["altNames"]) {
_customIcons[name] = CustomIconData(
icon["slug"],
icon["hex"],
);
}
}
}
} catch (e) {
Logger("IconUtils").severe("Error loading icons", e);