Skip to content

Commit

Permalink
support any case of nano.to usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
nano2dev committed Mar 14, 2024
1 parent dfe0260 commit 2590b81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/status_action_bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2590b81

Please sign in to comment.