9 private const SHOW_DELAY = 86400;
13 return CurrentUser::get()->isAdmin()
14 ? $this->isEnabledForAdmin(
$type)
15 : $this->isEnabledForUser(
$type);
20 $lastShowTimestamp = $this->userOption->get(
"marketSubscriptionCurtain{$type->value}Ts",
null);
22 if (!$lastShowTimestamp || !is_numeric($lastShowTimestamp))
27 return $lastShowTimestamp + self::SHOW_DELAY < time();
32 return $this->userOption->get(
"marketSubscriptionCurtain{$type->value}Dismiss",
'N') ===
'Y';
35 private function isEnabledForAdmin(CurtainPageType
$type): bool
42 return !$this->isDismissedByUser(
$type)
44 && $this->marketSubscriptionNotification->getPopup()->isDismissedByUser();
47 private function isEnabledForUser(CurtainPageType
$type): bool
49 if ($this->marketSubscriptionNotification->marketSubscription->isActive())
54 return !$this->isDismissedByUser(
$type)