48 lines
1.5 KiB
TypeScript
48 lines
1.5 KiB
TypeScript
// Module ID: 11673
|
|
// Function ID: 11674
|
|
// Name: BOOST_EXPIRING_DISPLAY_WINDOW_DAYS
|
|
// Dependencies: [11, 2]
|
|
// Exports: getBoostLifecycleInfo, getBoostLifecycleTimestamp
|
|
|
|
// Module 11673 (BOOST_EXPIRING_DISPLAY_WINDOW_DAYS)
|
|
let c2 = 259200000;
|
|
const result = require("set").fileFinishedImporting("modules/premium/powerups/utils/getBoostLifecyclePhase.tsx");
|
|
|
|
export const BOOST_EXPIRING_DISPLAY_WINDOW_DAYS = 3;
|
|
export const BOOST_EXPIRING_DISPLAY_WINDOW_MS = 259200000;
|
|
export const getBoostLifecycleInfo = function getBoostLifecycleInfo(ended, closure_4) {
|
|
if (!ended.ended) {
|
|
if (null != ended.endsAt) {
|
|
const endsAt = ended.endsAt;
|
|
return { phase: "expired" };
|
|
}
|
|
if (null != ended.endsAt) {
|
|
const endsAt2 = ended.endsAt;
|
|
if (endsAt2.getTime() - closure_4 <= c2) {
|
|
let obj = { phase: "expiring", endsAt: null };
|
|
obj[1] = ended.endsAt;
|
|
}
|
|
}
|
|
obj = { phase: "gave" };
|
|
}
|
|
};
|
|
export const getBoostLifecycleTimestamp = function getBoostLifecycleTimestamp(id, boostLifecycleInfo) {
|
|
const phase = boostLifecycleInfo.phase;
|
|
if ("gave" === phase) {
|
|
return importDefault(11).extractTimestamp(id.id);
|
|
} else if ("expiring" === phase) {
|
|
const endsAt2 = boostLifecycleInfo.endsAt;
|
|
return endsAt2.getTime() - c2;
|
|
} else if ("expired" === phase) {
|
|
const endsAt = id.endsAt;
|
|
let time;
|
|
if (endsAt != null) {
|
|
time = endsAt.getTime();
|
|
}
|
|
if (time == null) {
|
|
time = importDefault(11).extractTimestamp(id.id);
|
|
const obj = importDefault(11);
|
|
}
|
|
return time;
|
|
}
|
|
};
|