Support multiple names for the same service

This commit is contained in:
vishnukvmd 2023-11-13 16:32:08 +05:30
parent a13d2a065e
commit 16bb23d977
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);