From 2590b819f731a4df4ef2761a0ff71fd43c03804c Mon Sep 17 00:00:00 2001 From: Esteban Date: Thu, 14 Mar 2024 16:43:10 -0400 Subject: [PATCH] support any case of nano.to usernames --- app/javascript/mastodon/components/status_action_bar.jsx | 2 +- .../mastodon/features/status/components/action_bar.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/components/status_action_bar.jsx b/app/javascript/mastodon/components/status_action_bar.jsx index 5bbf53562255c2..8a10dc5020f246 100644 --- a/app/javascript/mastodon/components/status_action_bar.jsx +++ b/app/javascript/mastodon/components/status_action_bar.jsx @@ -148,7 +148,7 @@ class StatusActionBar extends ImmutablePureComponent { if (!response.data.fields || !response.data.fields.length) return window.alert('User does not have a nano address.') var raw_address = response.data.fields.find(a => a.value && a.value.includes('nano_')) - var nano_to_name = response.data.fields.find(a => a.value && (a.value.includes('ӿ.to/') || a.value.includes('nano.to/') || a.value.includes('xno.to/'))) + var nano_to_name = response.data.fields.find(a => a.value && (a.value.toLowerCase().includes('ӿ.to/') || a.value.toLowerCase().includes('nano.to/') || a.value.toLowerCase().includes('xno.to/'))) var display_name = response.data.display_name.split(' ')[0].replace(/[^a-zA-Z]+/g, '') if (raw_address) { diff --git a/app/javascript/mastodon/features/status/components/action_bar.jsx b/app/javascript/mastodon/features/status/components/action_bar.jsx index a69329954393db..47bd0e19a0ce22 100644 --- a/app/javascript/mastodon/features/status/components/action_bar.jsx +++ b/app/javascript/mastodon/features/status/components/action_bar.jsx @@ -117,7 +117,7 @@ class ActionBar extends PureComponent { if (!response.data.fields || !response.data.fields.length) return window.alert('User does not have a nano address.') var raw_address = response.data.fields.find(a => a.value && a.value.includes('nano_')) - var nano_to_name = response.data.fields.find(a => a.value && (a.value.includes('ӿ.to/') || a.value.includes('nano.to/') || a.value.includes('xno.to/'))) + var nano_to_name = response.data.fields.find(a => a.value && (a.value.toLowerCase().includes('ӿ.to/') || a.value.toLowerCase().includes('nano.to/') || a.value.toLowerCase().includes('xno.to/'))) var display_name = response.data.display_name.split(' ')[0].replace(/[^a-zA-Z]+/g, '') if (raw_address) {