Skip to content

Commit

Permalink
Merge pull request #583 from ianmcorvidae/username-suffix
Browse files Browse the repository at this point in the history
Small update to use the _first_ @ rather than the last for username truncation
  • Loading branch information
ianmcorvidae authored Jul 31, 2024
2 parents 489a7fd + 0f79414 commit 356a087
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 356a087

Please sign in to comment.