Skip to content

Commit

Permalink
👽 Remove discord username validation
Browse files Browse the repository at this point in the history
  • Loading branch information
GiyoMoon committed Sep 4, 2023
1 parent 36332e1 commit e0e34a4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
14 changes: 0 additions & 14 deletions shared/handlers/account.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useEffect, useState } from 'react'
import { createNotification } from '../stores/notification/notification.model'
import { notificationService } from '../stores/notification/notification.service'
import {
discordTagRegex,
steamTradeLinkRegex,
steamProfileLinkRegex,
} from '../stores/user/user.model'
Expand Down Expand Up @@ -125,19 +124,6 @@ const AccountSettingsHandler = () => {
return
}

if (
formValue.discordTag.trim() &&
!discordTagRegex.test(formValue.discordTag)
) {
const notification = createNotification({
content: 'Invalid Discord tag',
duration: 5000,
type: 'warning',
})
notificationService.addNotification(notification)
return
}

userService
.updateAccountSettings({
displayName: formValue.displayName,
Expand Down
3 changes: 1 addition & 2 deletions shared/stores/user/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,5 @@ const steamProfileLinkRegex =
/^(?:https?:\/\/)?steamcommunity\.com\/(?:profiles|id)\/[a-zA-Z0-9\-._~]+\/?$/
const steamTradeLinkRegex =
/^(?:https?:\/\/)?steamcommunity\.com\/tradeoffer\/new\/?\?partner=[0-9]+&token=[a-zA-Z0-9_-]+$/
const discordTagRegex = /^.{2,32}#[0-9]{4}$/

export { steamProfileLinkRegex, steamTradeLinkRegex, discordTagRegex }
export { steamProfileLinkRegex, steamTradeLinkRegex }

0 comments on commit e0e34a4

Please sign in to comment.