decord/source/modules/parent_tools/ParentalConsentWarningStore.tsx

126 lines
3.5 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 14292
// Function ID: 14293
2026-07-29 08:29:29 +00:00
// Name: initialize
// Dependencies: [589, 709, 2]
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
// Module 14292 (initialize)
import initializeDefault from "initialize" /* 589 */;
import dispatcherDefault from "dispatcher" /* 709 */;
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
let c0 = null;
let c1 = null;
let c2 = null;
2026-08-24 06:08:38 +00:00
const PersistedStore = initializeDefault.PersistedStore;
2026-07-29 08:29:29 +00:00
class ParentalConsentWarningStore extends PersistedStore {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = ParentalConsentWarningStore.prototype;
prototype["initialize"] = function initialize(lastWarningFetchDayStart) {
let prop;
if (lastWarningFetchDayStart != null) {
prop = lastWarningFetchDayStart.lastWarningFetchDayStart;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (prop == null) {
prop = null;
}
let prop1;
if (lastWarningFetchDayStart != null) {
prop1 = lastWarningFetchDayStart.lastModalShownDayStart;
}
if (prop1 == null) {
prop1 = null;
}
let warning;
if (lastWarningFetchDayStart != null) {
warning = lastWarningFetchDayStart.warning;
}
if (warning == null) {
warning = null;
}
};
prototype["getWarning"] = function getWarning() {
return c2;
};
prototype["shouldFetchToday"] = function shouldFetchToday() {
let tmp = null == c0;
if (!tmp) {
const _Date = Date;
const date = new Date();
date.setHours(0, 0, 0, 0);
tmp = c0 !== date.getTime();
}
return tmp;
};
prototype["hasShownModalToday"] = function hasShownModalToday() {
let tmp = null != c1;
if (tmp) {
const _Date = Date;
const date = new Date();
date.setHours(0, 0, 0, 0);
tmp = c1 === date.getTime();
}
return tmp;
};
prototype["getState"] = function getState() {
return { lastWarningFetchDayStart: c0, lastModalShownDayStart: c1, warning: c2 };
};
ParentalConsentWarningStore.displayName = "ParentalConsentWarningStore";
ParentalConsentWarningStore.persistKey = "ParentalConsentWarningStore";
const items = [
2026-07-20 16:05:17 +00:00
(lastWarningFetchDayStart) => {
let prop;
2026-07-29 08:29:29 +00:00
if (lastWarningFetchDayStart != null) {
2026-07-20 16:05:17 +00:00
prop = lastWarningFetchDayStart.lastWarningFetchDayStart;
}
2026-07-29 08:29:29 +00:00
if (prop == null) {
prop = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj = { lastWarningFetchDayStart: prop, lastModalShownDayStart: null, warning: null };
2026-07-20 16:05:17 +00:00
let prop1;
2026-07-29 08:29:29 +00:00
if (lastWarningFetchDayStart != null) {
2026-07-20 16:05:17 +00:00
prop1 = lastWarningFetchDayStart.lastModalShownDayStart;
}
2026-07-29 08:29:29 +00:00
if (prop1 == null) {
prop1 = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = prop1;
2026-07-20 16:05:17 +00:00
let warning;
2026-07-29 08:29:29 +00:00
if (lastWarningFetchDayStart != null) {
2026-07-20 16:05:17 +00:00
warning = lastWarningFetchDayStart.warning;
}
2026-07-29 08:29:29 +00:00
if (warning == null) {
warning = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = warning;
2026-07-20 16:05:17 +00:00
return obj;
}
];
2026-07-29 08:29:29 +00:00
ParentalConsentWarningStore.migrations = items;
2026-08-24 06:08:38 +00:00
const parentalConsentWarningStore = new ParentalConsentWarningStore(dispatcherDefault, {
2026-07-20 16:05:17 +00:00
PARENTAL_CONSENT_WARNING_FETCH_SUCCESS: function handleFetchSuccess(warning) {
warning = warning.warning;
2026-07-29 08:29:29 +00:00
const date = new Date();
date.setHours(0, 0, 0, 0);
const time = date.getTime();
parentalConsentWarningStore.persist();
2026-07-20 16:05:17 +00:00
},
PARENTAL_CONSENT_WARNING_MODAL_SHOWN: function handleModalShown() {
2026-07-29 08:29:29 +00:00
const date = new Date();
date.setHours(0, 0, 0, 0);
const time = date.getTime();
parentalConsentWarningStore.persist();
2026-07-20 16:05:17 +00:00
},
PARENTAL_CONSENT_WARNING_CLEARED: function handleWarningCleared() {
2026-08-24 06:08:38 +00:00
c2 = null;
2026-07-29 08:29:29 +00:00
parentalConsentWarningStore.persist();
2026-07-20 16:05:17 +00:00
},
LOGOUT: function handleLogout() {
2026-08-24 06:08:38 +00:00
c0 = null;
c1 = null;
c2 = null;
2026-07-29 08:29:29 +00:00
parentalConsentWarningStore.persist();
2026-07-20 16:05:17 +00:00
}
});
2026-07-29 08:29:29 +00:00
const result = require("set").fileFinishedImporting("modules/parent_tools/ParentalConsentWarningStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default parentalConsentWarningStore;