Skip to content

Commit

Permalink
Small update to use the _first_ @ rather than the last for username t…
Browse files Browse the repository at this point in the history
…runcation
  • Loading branch information
ianmcorvidae committed Jul 30, 2024
1 parent 489a7fd commit 0f79414
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/instantlaunches/functions.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Removes a suffix from the username. Everything after the last '@' will be removed.
* Removes a suffix from the username. Everything starting from the first '@' will be removed.
*
* @param {string} username - The username that will be shortened
* @returns {string} - The shortened username
*/
export const shortenUsername = (username) => {
const atIndex = username.lastIndexOf("@");
const atIndex = username.indexOf("@");
if (atIndex > -1) {
return username.slice(0, atIndex);
}
Expand Down

0 comments on commit 0f79414

Please sign in to comment.