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

59 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-07-30 10:14:41 +00:00
// Module ID: 8092
// Function ID: 8093
2026-07-20 16:05:17 +00:00
// Name: useBadges
2026-07-29 08:29:29 +00:00
// Dependencies: [4029, 1874, 3862, 647, 1236, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-30 10:14:41 +00:00
// Module 8092 (useBadges)
2026-07-29 08:29:29 +00:00
import initialize from "initialize";
import mergeGuildAvatar from "mergeGuildAvatar";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
const legacy_username = "legacy_username";
2026-07-23 10:11:24 +00:00
const result = require("explicitContentFromProto").fileFinishedImporting("modules/user_profile/hooks/useBadges.tsx");
2026-07-20 16:05:17 +00:00
export default function useBadges(getBadges) {
2026-07-29 08:29:29 +00:00
const LegacyUsernameDisabled = require(3862) /* 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);
const items = [mergeGuildAvatar];
const stateFromStores = tmpResult.useStateFromStores(items, () => currentUser.getCurrentUser());
tmpResult = tmp(647);
[][0] = initialize;
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";