decord/source/modules/premium/powerups/utils/getBoostLifecyclePhase.tsx

52 lines
1.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11799
// Function ID: 11800
2026-07-20 16:05:17 +00:00
// Name: BOOST_EXPIRING_DISPLAY_WINDOW_DAYS
2026-07-29 08:29:29 +00:00
// Dependencies: [11, 2]
2026-07-20 16:05:17 +00:00
// Exports: getBoostLifecycleInfo, getBoostLifecycleTimestamp
2026-08-24 06:08:38 +00:00
// Module 11799 (BOOST_EXPIRING_DISPLAY_WINDOW_DAYS)
import set from "set" /* 2 */;
import DISCORD_EPOCHDefault from "DISCORD_EPOCH" /* 11 */;
2026-07-29 08:29:29 +00:00
let c2 = 259200000;
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("modules/premium/powerups/utils/getBoostLifecyclePhase.tsx");
2026-07-20 16:05:17 +00:00
export const BOOST_EXPIRING_DISPLAY_WINDOW_DAYS = 3;
export const BOOST_EXPIRING_DISPLAY_WINDOW_MS = 259200000;
2026-08-04 21:03:28 +00:00
export const getBoostLifecycleInfo = function getBoostLifecycleInfo(ended, closure_3) {
2026-07-20 16:05:17 +00:00
if (!ended.ended) {
if (null != ended.endsAt) {
const endsAt = ended.endsAt;
2026-07-29 08:29:29 +00:00
return { phase: "expired" };
2026-07-20 16:05:17 +00:00
}
if (null != ended.endsAt) {
const endsAt2 = ended.endsAt;
2026-08-04 21:03:28 +00:00
if (endsAt2.getTime() - closure_3 <= c2) {
2026-07-29 08:29:29 +00:00
let obj = { phase: "expiring", endsAt: null };
obj[1] = ended.endsAt;
2026-07-20 16:05:17 +00:00
}
}
obj = { phase: "gave" };
}
};
export const getBoostLifecycleTimestamp = function getBoostLifecycleTimestamp(id, boostLifecycleInfo) {
const phase = boostLifecycleInfo.phase;
if ("gave" === phase) {
2026-08-24 06:08:38 +00:00
return DISCORD_EPOCHDefault.extractTimestamp(id.id);
2026-07-20 16:05:17 +00:00
} else if ("expiring" === phase) {
const endsAt2 = boostLifecycleInfo.endsAt;
2026-07-29 08:29:29 +00:00
return endsAt2.getTime() - c2;
2026-07-20 16:05:17 +00:00
} else if ("expired" === phase) {
const endsAt = id.endsAt;
let time;
2026-07-29 08:29:29 +00:00
if (endsAt != null) {
2026-07-20 16:05:17 +00:00
time = endsAt.getTime();
}
2026-07-29 08:29:29 +00:00
if (time == null) {
2026-08-24 06:08:38 +00:00
time = DISCORD_EPOCHDefault.extractTimestamp(id.id);
const obj = DISCORD_EPOCHDefault;
2026-07-20 16:05:17 +00:00
}
return time;
}
};