From b164984abb637aff279f8f6c491a496fbb1e57f1 Mon Sep 17 00:00:00 2001 From: naskya Date: Fri, 21 Jul 2023 13:18:21 +0000 Subject: [PATCH] fix: show correct software names (close #30) --- .../src/components/MkInstanceTicker.vue | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/MkInstanceTicker.vue b/packages/client/src/components/MkInstanceTicker.vue index d998ca2f7..d66d3238a 100644 --- a/packages/client/src/components/MkInstanceTicker.vue +++ b/packages/client/src/components/MkInstanceTicker.vue @@ -38,7 +38,29 @@ const instance = props.instance ?? { softwareName: Instance.softwareName || "Firefish", }; -const capitalize = (s: string) => s && s[0].toUpperCase() + s.slice(1); +const commonNames = new Map([ + ["birdsitelive", "BirdsiteLIVE"], + ["bookwyrm", "BookWyrm"], + ["foundkey", "FoundKey"], + ["gnusocial", "GNU Social"], + ["gotosocial", "GoToSocial"], + ["microblogpub", "microblog.pub"], + ["nextcloud social", "Nextcloud Social"], + ["peertube", "PeerTube"], + ["snac", "snac"], + ["snac2", "snac2"], + ["takahe", "Takahē"], + ["wafrn", "WAFRN"], + ["wordpress", "WordPress"], + ["writefreely", "WriteFreely"], + ["wxwclub", "wxwClub"], +]); + +const capitalize = (s: string) => { + if (s == null) return "Unknown"; + if (commonNames.has(s)) return commonNames.get(s); + return s[0].toUpperCase() + s.slice(1); +}; const computedStyle = getComputedStyle(document.documentElement); const themeColor =