decord/stable/source/modules/install/native/InstallTime.tsx
github-actions 57c2214117 chore: update source for stable 347.12
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
2026-09-29 21:26:22 +00:00

70 lines
2.1 KiB
TypeScript

// Module ID: 13993
// Function ID: 13994
// Name: InstallTime
// Dependencies: [502, 510, 13994, 4817, 2]
// Exports: getFirstInstallTimeElapsed
// Module 13993 (InstallTime)
import Storage4 from "Storage" /* 510 */;
import TimeUtils from "TimeUtils" /* 4817 */;
import NativeInstallTimeModuleDefault from "NativeInstallTimeModule" /* 13994 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
require = fn;
function getFirstInstallTimeMillis(arg0) {
const firstInstallTimeMillis = NativeInstallTimeModuleDefault.getFirstInstallTimeMillis();
let str = "InstallTimeLaunch";
if ("authed" === arg0.from) {
str = "InstallTimeAuthed";
}
const Storage = Storage4.Storage;
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 (AuthenticationStore.isAuthenticated()) {
const _Date2 = Date;
const timestamp = Date.now();
const Storage3 = tmp4(510).Storage;
const result = Storage3.set(str, timestamp);
num2 = timestamp;
}
} else {
num2 = firstInstallTimeMillis;
if (firstInstallTimeMillis <= 0) {
const _Date = Date;
num2 = Date.now();
}
const Storage2 = tmp4(510).Storage;
const result1 = Storage2.set(str, num2);
}
}
const size = fn(2);
let result = size.fileFinishedImporting("modules/install/native/InstallTime.tsx");
export { getFirstInstallTimeMillis };
export const getFirstInstallTimeElapsed = function getFirstInstallTimeElapsed(unit) {
unit = unit.unit;
const tmp = getFirstInstallTimeMillis(Object.assign(unit, Object.assign({ unit: 0 })));
if (0 === tmp) {
return 0;
} else {
const _Date = Date;
const diff = Date.now() - tmp;
let result = diff;
if (null != unit) {
result = TimeUtils.convertMinutesToGivenTimeUnit(diff / TimeUtils.MS_PER_MINUTE, unit);
}
return result;
}
};