Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
62 lines
1.8 KiB
TypeScript
62 lines
1.8 KiB
TypeScript
// Module ID: 8358
|
|
// Function ID: 8359
|
|
// Name: useBadges
|
|
// Dependencies: [4482, 1371, 1935, 563, 1114, 2]
|
|
// Exports: default
|
|
|
|
// Module 8358 (useBadges)
|
|
import useStateFromStores from "useStateFromStores" /* 563 */;
|
|
import util from "util" /* 1114 */;
|
|
import UserSettings from "UserSettings" /* 1935 */;
|
|
import StreamerModeStore from "StreamerModeStore" /* 4482 */;
|
|
import UserStore from "UserStore" /* 1371 */;
|
|
|
|
require = fn;
|
|
const legacy_username = "legacy_username";
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/user_profile/hooks/useBadges.tsx");
|
|
|
|
export default function useBadges(getBadges, arg1) {
|
|
const LegacyUsernameDisabled = UserSettings.LegacyUsernameDisabled;
|
|
let setting = LegacyUsernameDisabled.useSetting();
|
|
if (undefined !== arg1) {
|
|
setting = arg1;
|
|
}
|
|
const items = [UserStore];
|
|
const stateFromStores = useStateFromStores.useStateFromStores(items, () => currentUser.getCurrentUser());
|
|
useStateFromStores;
|
|
[][0] = StreamerModeStore;
|
|
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 !== legacy_username);
|
|
}
|
|
let mapped = found;
|
|
if (tmp6) {
|
|
mapped = found.map((id) => {
|
|
const obj = {};
|
|
const merged = Object.assign(id);
|
|
if (id.id === legacy_username) {
|
|
const intl = util.intl;
|
|
let description = intl.string(util.t.Br1ls3);
|
|
} else {
|
|
description = id.description;
|
|
}
|
|
obj.description = description;
|
|
return obj;
|
|
});
|
|
}
|
|
return mapped;
|
|
}
|
|
const tmpResult = useStateFromStores;
|
|
};
|
|
export const QUEST_COMPLETED_BADGE = "quest_completed";
|