export default {
  isPromotion: false,
  setBadgeCount(info={}) {
    global.alertBadgeCountInfo = info;
  },
  getAlertCount() {
    return global.alertBadgeCountInfo?.alertCount || 0
  },
  getNewsCount() {
    return global.alertBadgeCountInfo?.newsCount || 0
  },
  getCampaignCount() {
    return global.alertBadgeCountInfo?.campaignCount || 0
  },
  getUnreadAlert() {
    return global.alertBadgeCountInfo?.alertUnreadCount || 0
  },
  setOnRefreshListener(listener) {
    global.notificationPageListener = listener;
  },
  requestRefresh() {
    if (global.notificationPageListener) {
      global.notificationPageListener();
    }
  },
  release() {
    global.alertBadgeCountInfo = {};
    global.notificationPageListener = undefined;
  }
}