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
@@ -2,12 +2,29 @@ import stringToHTML from "../stringToHTML";
import { settingsState } from "../listeners/SettingsState";
import { openPopup } from "./PopupManager";
export function showPrivacyNotification() {
const lastUpdated = "2025-12-19";
const PRIVACY_STATEMENT_VERSION = "2025-12-19";
if (document.getElementById("whatsnewbk")) return;
if (settingsState.privacyStatementShown) return;
if (settingsState.privacyStatementLastUpdated && new Date(settingsState.privacyStatementLastUpdated) > new Date(lastUpdated)) return;
export function shouldShowPrivacyNotification(): boolean {
if (settingsState.privacyStatementShown) return false;
if (
settingsState.privacyStatementLastUpdated &&
new Date(settingsState.privacyStatementLastUpdated) >
new Date(PRIVACY_STATEMENT_VERSION)
) {
return false;
}
return true;
}
export function showPrivacyNotification(onDismissed?: () => void) {
if (document.getElementById("whatsnewbk")) {
onDismissed?.();
return;
}
if (!shouldShowPrivacyNotification()) {
onDismissed?.();
return;
}
const header = stringToHTML(
/* html */
@@ -48,5 +65,6 @@ export function showPrivacyNotification() {
openPopup({
header,
content: [text],
afterClose: onDismissed,
});
}