62 lines
4.2 KiB
TypeScript
62 lines
4.2 KiB
TypeScript
/* Metro module 14471; source: modules/notification_center/useRelativeTimestamp.tsx; dependencies: [57, 31, 4788, 672, 2] */
|
|
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as NotificationCenterUtilsModule from './NotificationCenterUtils.tsx'; /* Metro dependency 4788 */
|
|
|
|
function _fun109503(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#109503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14668:6, offset: 0x0234f8ad, size: 137 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/notification_center/useRelativeTimestamp.tsx');
|
|
exports.useRelativeTimestamp = useRelativeTimestamp;
|
|
function useRelativeTimestamp({timestamp, abbreviated}) { // fn#109504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14668:225, offset: 0x0234f936, size: 123 bytes, params: 2, frame: 17
|
|
abbreviated = abbreviated === undefined || abbreviated;
|
|
const value = Module00057(ReactModule.useState(_fun109505), 2);
|
|
const property = value[0];
|
|
const env0_2 = value[1];
|
|
ReactModule.useEffect(_fun109506, [timestamp, abbreviated]);
|
|
return property;
|
|
function _fun109505() { // fn#109505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14668:305, offset: 0x0234f9b1, size: 50 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
return (NotificationCenterUtilsModule).getRelativeTimestamp(timestamp,
|
|
abbreviated);
|
|
}
|
|
|
|
function _fun109506() { // fn#109506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14668:388, offset: 0x0234f9e3, size: 251 bytes, params: 1, frame: 19
|
|
const binding = env0_2;
|
|
const getRelativeTimestamp = NotificationCenterUtilsModule.getRelativeTimestamp;
|
|
const timestampBinding = timestamp;
|
|
binding(Reflect.apply(getRelativeTimestamp, NotificationCenterUtilsModule, [timestampBinding, abbreviated]));
|
|
const Date = global.Date;
|
|
let value = Date.now() - timestampBinding;
|
|
let Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const DAY = Millis.DAY;
|
|
if (value > DAY) {
|
|
return undefined;
|
|
}
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const HOUR = Millis.HOUR;
|
|
const r5 = value >= HOUR ? (importDefault(672) /* metro dependency 672: Durations */).Millis.HOUR : (importDefault(672) /* metro dependency 672: Durations */).Millis.MINUTE;
|
|
const setInterval = global.setInterval;
|
|
value = r5 - value % r5;
|
|
const env0_0 = setInterval(_fun109507, r5, value);
|
|
return _fun109508;
|
|
function _fun109507() { // fn#109507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14668:563, offset: 0x0234fade, size: 59 bytes, params: 1, frame: 15
|
|
const binding = env1_2;
|
|
const getRelativeTimestamp = NotificationCenterUtilsModule.getRelativeTimestamp;
|
|
binding(Reflect.apply(getRelativeTimestamp, NotificationCenterUtilsModule, [timestamp, abbreviated]));
|
|
}
|
|
|
|
function _fun109508() { // fn#109508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14668:622, offset: 0x013378b1, size: 24 bytes, params: 1, frame: 11
|
|
return global.clearInterval(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun109503, 14471, [57, 31, 4788, 672, 2]) /* metro module 14471, dependencies: [57, 31, 4788, 672, 2] */;
|