Skip to content

Commit ae3168b

Browse files
authored
KEP-1929 Prevent noti on partner-swap page (#2398)
1 parent 7f539fa commit ae3168b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/Announcement/helper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ export const ackAnnouncementPopup = (id: string | number) => {
2323

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

26+
const NO_NOTI_PAGES = [APP_PATHS.IAM_CONSENT, APP_PATHS.IAM_LOGIN, APP_PATHS.IAM_LOGOUT, APP_PATHS.PARTNER_SWAP]
27+
2628
export const isPopupCanShow = (
2729
popupInfo: PopupItemType<PopupContentAnnouncement>,
2830
chainId: ChainId,
2931
account: string | undefined,
3032
) => {
31-
if ([APP_PATHS.IAM_CONSENT, APP_PATHS.IAM_LOGIN, APP_PATHS.IAM_LOGOUT].includes(window.location.pathname))
33+
if (NO_NOTI_PAGES.some(path => window.location.pathname.startsWith(path))) {
3234
return false
35+
}
3336

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

0 commit comments

Comments
 (0)