decord/source/modules/user_profile/hooks/useBadges.tsx

60 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9020
// Function ID: 9021
2026-07-20 16:05:17 +00:00
// Name: useBadges
2026-08-24 06:08:38 +00:00
// Dependencies: [4224, 1922, 4069, 647, 1236, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 9020 (useBadges)
import explicitContentFromProto from "explicitContentFromProto" /* 4069 */;
import closure_2 from "initialize" /* 4224 */;
import closure_3 from "mergeGuildAvatar" /* 1922 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
const legacy_username = "legacy_username";
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/user_profile/hooks/useBadges.tsx");
2026-07-20 16:05:17 +00:00
export default function useBadges(getBadges) {
2026-08-24 06:08:38 +00:00
const LegacyUsernameDisabled = explicitContentFromProto.LegacyUsernameDisabled;
2026-07-20 16:05:17 +00:00
let setting = LegacyUsernameDisabled.useSetting();
if (undefined !== arg1) {
setting = arg1;
}
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(647);
2026-08-24 06:08:38 +00:00
const items = [closure_3];
2026-07-29 08:29:29 +00:00
const stateFromStores = tmpResult.useStateFromStores(items, () => currentUser.getCurrentUser());
tmpResult = tmp(647);
2026-08-24 06:08:38 +00:00
[][0] = closure_2;
2026-07-20 16:05:17 +00:00
if (null == getBadges) {
return [];
} else {
let badges;
2026-07-29 08:29:29 +00:00
if (getBadges != null) {
2026-07-20 16:05:17 +00:00
badges = getBadges.getBadges();
}
2026-07-29 08:29:29 +00:00
if (badges == null) {
2026-07-20 16:05:17 +00:00
badges = [];
}
let found = badges;
2026-07-29 08:29:29 +00:00
if (tmp7) {
found = badges.filter((id) => id.id !== closure_4);
2026-07-20 16:05:17 +00:00
}
let mapped = found;
2026-07-29 08:29:29 +00:00
if (tmp6) {
2026-07-20 16:05:17 +00:00
mapped = found.map((id) => {
const obj = {};
const merged = Object.assign(id);
2026-07-29 08:29:29 +00:00
if (id.id === closure_4) {
const intl = callback(1236).intl;
let description = intl.string(callback(1236).t.Br1ls3);
2026-07-20 16:05:17 +00:00
} else {
description = id.description;
}
2026-07-29 08:29:29 +00:00
obj.description = description;
2026-07-20 16:05:17 +00:00
return obj;
});
}
return mapped;
}
};
export const QUEST_COMPLETED_BADGE = "quest_completed";