feat: queue popups and new engage popup

This commit is contained in:
2026-04-12 19:54:43 +09:30
parent 2e9a643a8c
commit 1d9b8f3747
9 changed files with 188 additions and 17 deletions
@@ -0,0 +1,39 @@
import { settingsState } from "../listeners/SettingsState";
import { OpenWhatsNewPopup } from "./OpenWhatsNewPopup";
import {
shouldShowPrivacyNotification,
showPrivacyNotification,
} from "./OpenPrivacyNotification";
import {
shouldShowEngageParentsAnnouncement,
showEngageParentsAnnouncement,
} from "./OpenEngageParentsAnnouncement";
type QueueStep = (goNext: () => void) => void;
/**
* Runs startup modals in order: What's New (if the extension just updated),
* privacy statement (if required), then the SEQTA Engage announcement (once).
*/
export function runStartupPopupQueue() {
const steps: QueueStep[] = [];
if (settingsState.justupdated) {
steps.push((goNext) => OpenWhatsNewPopup(goNext));
}
if (shouldShowPrivacyNotification()) {
steps.push((goNext) => showPrivacyNotification(goNext));
}
if (shouldShowEngageParentsAnnouncement()) {
steps.push((goNext) => showEngageParentsAnnouncement(goNext));
}
function runNext() {
const step = steps.shift();
if (step) step(runNext);
}
runNext();
}