Skip to content

Commit

Permalink
KEP-1929 Prevent noti on partner-swap page (#2398)
Browse files Browse the repository at this point in the history
  • Loading branch information
neikop authored Nov 23, 2023
1 parent 7f539fa commit ae3168b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Announcement/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ export const ackAnnouncementPopup = (id: string | number) => {

export const formatNumberOfUnread = (num: number | undefined) => (num ? (num > 10 ? '10+' : num + '') : null)

const NO_NOTI_PAGES = [APP_PATHS.IAM_CONSENT, APP_PATHS.IAM_LOGIN, APP_PATHS.IAM_LOGOUT, APP_PATHS.PARTNER_SWAP]

export const isPopupCanShow = (
popupInfo: PopupItemType<PopupContentAnnouncement>,
chainId: ChainId,
account: string | undefined,
) => {
if ([APP_PATHS.IAM_CONSENT, APP_PATHS.IAM_LOGIN, APP_PATHS.IAM_LOGOUT].includes(window.location.pathname))
if (NO_NOTI_PAGES.some(path => window.location.pathname.startsWith(path))) {
return false
}

const { templateBody = {}, metaMessageId } = popupInfo.content
const { endAt, startAt, chainIds = [] } = templateBody as AnnouncementTemplatePopup
Expand Down

0 comments on commit ae3168b

Please sign in to comment.