59 lines
1.7 KiB
TypeScript
59 lines
1.7 KiB
TypeScript
// Module ID: 8242
|
|
// Function ID: 8243
|
|
// Name: useBadges
|
|
// Dependencies: [4405, 1371, 1935, 563, 1114, 2]
|
|
// Exports: default
|
|
|
|
// Module 8242 (useBadges)
|
|
import explicitContentFromProto from "explicitContentFromProto" /* 1935 */;
|
|
import closure_2 from "initialize" /* 4405 */;
|
|
import closure_3 from "mergeGuildAvatar" /* 1371 */;
|
|
|
|
require = arg1;
|
|
const legacy_username = "legacy_username";
|
|
const result = require("set").fileFinishedImporting("modules/user_profile/hooks/useBadges.tsx");
|
|
|
|
export default function useBadges(getBadges) {
|
|
const LegacyUsernameDisabled = explicitContentFromProto.LegacyUsernameDisabled;
|
|
let setting = LegacyUsernameDisabled.useSetting();
|
|
if (undefined !== arg1) {
|
|
setting = arg1;
|
|
}
|
|
let tmpResult = tmp(563);
|
|
const items = [closure_3];
|
|
const stateFromStores = tmpResult.useStateFromStores(items, () => currentUser.getCurrentUser());
|
|
tmpResult = tmp(563);
|
|
[][0] = closure_2;
|
|
if (null == getBadges) {
|
|
return [];
|
|
} else {
|
|
let badges;
|
|
if (getBadges != null) {
|
|
badges = getBadges.getBadges();
|
|
}
|
|
if (badges == null) {
|
|
badges = [];
|
|
}
|
|
let found = badges;
|
|
if (tmp7) {
|
|
found = badges.filter((id) => id.id !== closure_4);
|
|
}
|
|
let mapped = found;
|
|
if (tmp6) {
|
|
mapped = found.map((id) => {
|
|
const obj = {};
|
|
const merged = Object.assign(id);
|
|
if (id.id === closure_4) {
|
|
const intl = callback(1114).intl;
|
|
let description = intl.string(callback(1114).t.Br1ls3);
|
|
} else {
|
|
description = id.description;
|
|
}
|
|
obj.description = description;
|
|
return obj;
|
|
});
|
|
}
|
|
return mapped;
|
|
}
|
|
};
|
|
export const QUEST_COMPLETED_BADGE = "quest_completed";
|