Fix megaphone check for dontShowBeforeEpochMs

This commit is contained in:
ayumi-signal
2026-02-18 10:27:25 -08:00
committed by GitHub
parent 55ffb28481
commit 6aca6a278a
2 changed files with 13 additions and 1 deletions

View File

@@ -194,6 +194,7 @@ export function isMegaphoneShowable(
): megaphone is VisibleRemoteMegaphoneType {
const nowMs = Date.now();
const {
dontShowBeforeEpochMs,
dontShowAfterEpochMs,
isFinished,
snoozedAt,
@@ -201,7 +202,11 @@ export function isMegaphoneShowable(
secondaryCtaId,
} = megaphone;
if (isFinished || nowMs > dontShowAfterEpochMs) {
if (
isFinished ||
nowMs < dontShowBeforeEpochMs ||
nowMs > dontShowAfterEpochMs
) {
return false;
}