mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
feat: queue popups and new engage popup
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user