Skip to content

Commit

Permalink
Merge branch 'main' into profile-imp-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh authored Jul 17, 2023
2 parents 141f3dc + 8d66f96 commit 8104d00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const NavLinkBetween = styled(MenuItem)`
justify-content: space-between;
position: unset !important;
max-height: 40px;
cursor: pointer;
svg {
margin: 0;
width: unset;
Expand Down
5 changes: 4 additions & 1 deletion src/utils/iamError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const sendError = (name: string, apiUrl: string, trackData: any) => {
captureException(error, { level: 'fatal', extra: { args: JSON.stringify(trackData, null, 2) } })
}

// hot fix to prevent spam for now.
const blacklistPathBff = ['/v1/notification/me']

/**
* check error status: blocked, maybe cors issues or server down
* only check bff api + 2 route apis
Expand Down Expand Up @@ -55,7 +58,7 @@ export const checkIamDown = (axiosErr: AxiosError) => {
const isRouteApiDie =
isDie && (apiUrl.endsWith(AGGREGATOR_API_PATHS.GET_ROUTE) || apiUrl.endsWith(AGGREGATOR_API_PATHS.BUILD_ROUTE))

const isIamDie = isDie && apiUrl.startsWith(BFF_API)
const isIamDie = isDie && apiUrl.startsWith(BFF_API) && !blacklistPathBff.some(path => apiUrl.endsWith(path))

if (isRouteApiDie) {
ErrorInfo.routeApiError++
Expand Down
2 changes: 1 addition & 1 deletion src/utils/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const escapeScriptHtml = (str: string) => {
return str.replace(/<.*?script.*?>.*?<\/.*?script.*?>/gim, '')
}

export const isEmailValid = (value: string | undefined) => value?.match(/\S+@\S+\.\S+/)
export const isEmailValid = (value: string | undefined) => value?.match(/^\w+([\.-]?\w)*@\w+([\.-]?\w)*(\.\w{2,10})+$/)

export const getChainIdFromSlug = (network: string | undefined) => {
return Object.values(NETWORKS_INFO).find(n => n.route === network)?.chainId
Expand Down

0 comments on commit 8104d00

Please sign in to comment.