decord/source/modules/install/native/InstallTime.tsx

71 lines
2 KiB
TypeScript
Raw Normal View History

2026-08-26 06:04:24 +00:00
// Module ID: 13239
// Function ID: 13240
2026-07-20 16:05:17 +00:00
// Name: getFirstInstallTimeMillis
2026-08-26 06:04:24 +00:00
// Dependencies: [1218, 595, 13240, 4522, 2]
2026-07-20 16:05:17 +00:00
// Exports: getFirstInstallTimeElapsed
2026-08-26 06:04:24 +00:00
// Module 13239 (getFirstInstallTimeMillis)
2026-08-24 06:08:38 +00:00
import Storage4 from "Storage" /* 595 */;
2026-08-26 06:04:24 +00:00
import sleep from "sleep" /* 4522 */;
import enforcingDefault from "enforcing" /* 13240 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "fetchFingerprint" /* 1218 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function getFirstInstallTimeMillis(arg0) {
2026-08-24 06:08:38 +00:00
const firstInstallTimeMillis = enforcingDefault.getFirstInstallTimeMillis();
2026-07-20 16:05:17 +00:00
let str = "InstallTimeLaunch";
if ("authed" === arg0.from) {
str = "InstallTimeAuthed";
}
2026-08-24 06:08:38 +00:00
const Storage = Storage4.Storage;
2026-07-20 16:05:17 +00:00
const value = Storage.get(str);
if (null != value) {
if (value > 0) {
let bound = value;
if (firstInstallTimeMillis > 0) {
const _Math = Math;
bound = Math.max(value, firstInstallTimeMillis);
}
let num2 = bound;
}
return num2;
}
if ("authed" === arg0.from) {
num2 = 0;
if (authenticated.isAuthenticated()) {
const _Date2 = Date;
const timestamp = Date.now();
2026-07-29 08:29:29 +00:00
const Storage3 = tmp4(595).Storage;
2026-07-20 16:05:17 +00:00
const result = Storage3.set(str, timestamp);
num2 = timestamp;
}
} else {
num2 = firstInstallTimeMillis;
if (firstInstallTimeMillis <= 0) {
const _Date = Date;
num2 = Date.now();
}
2026-07-29 08:29:29 +00:00
const Storage2 = tmp4(595).Storage;
2026-07-20 16:05:17 +00:00
const result1 = Storage2.set(str, num2);
}
}
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/install/native/InstallTime.tsx");
2026-07-20 16:05:17 +00:00
export { getFirstInstallTimeMillis };
export const getFirstInstallTimeElapsed = function getFirstInstallTimeElapsed(unit) {
unit = unit.unit;
2026-07-29 08:29:29 +00:00
const tmp = getFirstInstallTimeMillis(Object.assign(unit, Object.create(null)));
if (0 === tmp) {
2026-07-20 16:05:17 +00:00
return 0;
} else {
const _Date = Date;
2026-07-29 08:29:29 +00:00
const diff = Date.now() - tmp;
2026-07-20 16:05:17 +00:00
let result = diff;
if (null != unit) {
2026-08-24 06:08:38 +00:00
result = sleep.convertMinutesToGivenTimeUnit(diff / sleep.MS_PER_MINUTE, unit);
const obj = sleep;
2026-07-20 16:05:17 +00:00
}
return result;
}
};