Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5012.js (118.4 MB)
71 lines
2.5 KiB
TypeScript
71 lines
2.5 KiB
TypeScript
// Module ID: 9497
|
|
// Function ID: 9498
|
|
// Name: ThreadAutoArchive
|
|
// Dependencies: [1114, 1091, 1115, 595, 4414, 2]
|
|
// Exports: getAutoArchiveDuration, getAutoArchiveDurationText
|
|
|
|
// Module 9497 (ThreadAutoArchive)
|
|
import memoizeDefault from "memoize" /* 595 */;
|
|
import DurationsDefault from "Durations" /* 1091 */;
|
|
import ThreadConstants from "ThreadConstants" /* 1114 */;
|
|
import util from "util" /* 1115 */;
|
|
import _modDef4414 from "module_4414" /* 4414 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
function getAutoArchiveOptions() {
|
|
const obj = { id: "1hour", label: null, value: null };
|
|
const intl = util.intl;
|
|
obj.label = intl.string(util.t.cs8A1c);
|
|
obj.value = DurationsDefault.Minutes.HOUR;
|
|
const items = [obj, , , ];
|
|
const obj2 = { id: "24hours", label: null, value: null };
|
|
const intl2 = util.intl;
|
|
obj2.label = intl2.string(util.t.zFKbrF);
|
|
obj2.value = DurationsDefault.Minutes.DAY;
|
|
items[1] = obj2;
|
|
const obj3 = { id: "3days", label: null, value: null };
|
|
const intl3 = util.intl;
|
|
obj3.label = intl3.string(util.t.TmPIZX);
|
|
obj3.value = 3 * DurationsDefault.Minutes.DAY;
|
|
items[2] = obj3;
|
|
const obj4 = { id: "1week", label: null, value: null };
|
|
const intl4 = util.intl;
|
|
obj4.label = intl4.string(util.t["/7i2el"]);
|
|
obj4.value = DurationsDefault.Minutes.WEEK;
|
|
items[3] = obj4;
|
|
return items;
|
|
}
|
|
let closure_3 = ThreadConstants.DEFAULT_AUTO_ARCHIVE_DURATION;
|
|
let items = [DurationsDefault.Minutes.HOUR, DurationsDefault.Minutes.DAY, 3 * DurationsDefault.Minutes.DAY, DurationsDefault.Minutes.WEEK];
|
|
const result = size.fileFinishedImporting("modules/threads/ThreadAutoArchive.tsx");
|
|
|
|
export const AUTO_ARCHIVE_OPTION_VALUES = items;
|
|
export { getAutoArchiveOptions };
|
|
export const getAutoArchiveDurations = memoizeDefault(() => getAutoArchiveOptions().map((value) => value.value));
|
|
export const getAutoArchiveDurationText = function getAutoArchiveDurationText(arg0) {
|
|
closure_0 = arg0;
|
|
const found = getAutoArchiveOptions().find((value) => value.value === closure_0);
|
|
let label;
|
|
if (found != null) {
|
|
label = found.label;
|
|
}
|
|
if (label == null) {
|
|
label = _modDef4414.duration(arg0, "minutes").humanize();
|
|
const durationResult = _modDef4414.duration(arg0, "minutes");
|
|
}
|
|
return label;
|
|
};
|
|
export const getAutoArchiveDuration = function getAutoArchiveDuration(channel, arg1) {
|
|
let tmp = arg1;
|
|
if (arg1 == null) {
|
|
let prop;
|
|
if (channel != null) {
|
|
prop = channel.defaultAutoArchiveDuration;
|
|
}
|
|
tmp = prop;
|
|
}
|
|
if (tmp == null) {
|
|
tmp = closure_3;
|
|
}
|
|
return tmp;
|
|
};
|