decord/source/modules/hub/HubProgressBarUtils.tsx

104 lines
3.4 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 12225
// Function ID: 12226
2026-07-29 08:29:29 +00:00
// Name: getHubProgressTitleForStep
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 1340, 5106, 9224, 676, 589, 1306, 1236, 1370, 1403, 2]
2026-07-20 16:05:17 +00:00
// Exports: getHubProgressTitleForStep, getNextHubProgressStep, useHubProgressBarCompletedSteps
2026-08-25 06:04:03 +00:00
// Module 12225 (getHubProgressTitleForStep)
2026-08-24 06:08:38 +00:00
import create from "create" /* 1306 */;
import closure_2 from "noop" /* 19 */;
import closure_3 from "handleConnectionClosedOrResumed" /* 1340 */;
2026-08-25 06:04:03 +00:00
import closure_4 from "set" /* 5106 */;
import { HUB_PROGRESS_STEP_ORDER } from "items" /* 9224 */;
2026-08-24 06:08:38 +00:00
import { PlatformTypes } from "ME" /* 676 */;
2026-07-21 06:55:02 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
const result = require("set").fileFinishedImporting("modules/hub/HubProgressBarUtils.tsx");
export const getHubProgressTitleForStep = function getHubProgressTitleForStep(nextHubProgressStep) {
2026-08-24 06:08:38 +00:00
if (create.HubProgressStep.JOIN_GUILD === nextHubProgressStep) {
2026-07-29 08:29:29 +00:00
const intl3 = tmp(1236).intl;
return intl3.string(tmp(1236).t.iNR25n);
} else if (tmp(1306).HubProgressStep.INVITE_USER === nextHubProgressStep) {
const intl2 = tmp(1236).intl;
return intl2.string(tmp(1236).t["3NlTYU"]);
} else if (tmp(1306).HubProgressStep.CONTACT_SYNC === nextHubProgressStep) {
const intl = tmp(1236).intl;
return intl.string(tmp(1236).t.HFvFte);
} else if (tmp(1306).HubProgressStep.NO_PROGRESS === nextHubProgressStep) {
return null;
2026-07-20 16:05:17 +00:00
} else {
2026-08-11 06:20:06 +00:00
tmp(1370).assertNever(nextHubProgressStep);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
export const useHubProgressBarCompletedSteps = function useHubProgressBarCompletedSteps(guild) {
let id;
if (guild != null) {
id = guild.id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let memo = id;
2026-08-24 06:08:38 +00:00
const items = [closure_3];
2026-07-29 08:29:29 +00:00
const stateFromStores = memo(stateFromStores1[5]).useStateFromStores(items, () => {
2026-07-20 16:05:17 +00:00
let num = 0;
2026-07-29 08:29:29 +00:00
if (null != memo) {
2026-08-24 06:08:38 +00:00
const guilds = closure_1_3.settings.guilds;
2026-07-29 08:29:29 +00:00
let num2;
if (guilds != null) {
if (guilds.guilds[tmp] != null) {
num2 = tmp3.hubProgress;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if (num2 == null) {
num2 = 0;
2026-07-20 16:05:17 +00:00
}
num = num2;
}
return num;
});
2026-07-29 08:29:29 +00:00
stateFromStores1 = stateFromStores;
2026-07-20 16:05:17 +00:00
const items1 = [stateFromStores];
2026-07-29 08:29:29 +00:00
memo = React.useMemo(() => (function convertHubProgressFlagSetToSet(stateFromStores1) {
2026-07-20 16:05:17 +00:00
const set = new Set();
2026-07-29 08:29:29 +00:00
for (const item10013 of closure_5) {
let tmp2 = callback;
let tmp3 = table;
let tmp = item10013;
let obj2 = callback(table[9]);
if (obj2.hasFlag(arg0, item10013)) {
let tmp4 = item10013;
let addResult = set.add(tmp);
}
continue;
2026-07-20 16:05:17 +00:00
}
return set;
2026-07-29 08:29:29 +00:00
})(stateFromStores1), items1);
const obj = memo(stateFromStores1[5]);
2026-08-24 06:08:38 +00:00
const items2 = [closure_4];
2026-07-29 08:29:29 +00:00
stateFromStores1 = memo(stateFromStores1[5]).useStateFromStores(items2, () => null != localAccount.getLocalAccount(constants.CONTACTS));
const items3 = [memo, stateFromStores1];
2026-07-20 16:05:17 +00:00
return React.useMemo(() => {
2026-07-29 08:29:29 +00:00
if (stateFromStores1) {
2026-07-20 16:05:17 +00:00
const _Set = Set;
2026-07-29 08:29:29 +00:00
const set = new Set(memo);
set.add(memo(stateFromStores1[6]).HubProgressStep.CONTACT_SYNC);
2026-07-20 16:05:17 +00:00
return set;
} else {
2026-07-29 08:29:29 +00:00
return memo;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}, items3);
2026-07-20 16:05:17 +00:00
};
export const getNextHubProgressStep = function getNextHubProgressStep(hubProgressBarCompletedSteps) {
2026-07-29 08:29:29 +00:00
for (const item10007 of HUB_PROGRESS_STEP_ORDER) {
let tmp = item10007;
if (arg0.has(item10007)) {
continue;
} else {
let tmp2 = item10007;
let tmp3 = obj;
obj.return();
return tmp;
2026-07-20 16:05:17 +00:00
}
}
return null;
};