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

46 lines
1.6 KiB
TypeScript
Raw Normal View History

// Module ID: 9164
// Function ID: 9165
// Name: useDisplayableBoardWidgets
// Dependencies: [19, 7738, 7735, 7728, 9165, 9166, 2]
2026-07-23 10:11:24 +00:00
// Exports: useDisplayableBoardWidgets
// Module 9164 (useDisplayableBoardWidgets)
import UserProfileApplicationWidgetTypes from "UserProfileApplicationWidgetTypes" /* 7738 */;
import useUserProfileWidgetsDefault from "useUserProfileWidgets" /* 9166 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-23 10:11:24 +00:00
function isNonEmptyBoardWidget(games) {
let tmp3 = games instanceof UserProfileApplicationWidgetTypes.ApplicationWidget;
2026-07-29 08:29:29 +00:00
if (!tmp3) {
let tmp4 = games instanceof tmp(7735).UserProfilePersonalWidget;
2026-08-06 08:05:19 +00:00
if (!tmp4) {
let isGameWidgetResult = tmp(7728).isGameWidget(games);
2026-08-06 08:05:19 +00:00
if (isGameWidgetResult) {
isGameWidgetResult = games.games.length > 0;
}
tmp4 = isGameWidgetResult;
const tmpResult = tmp(7728);
2026-07-23 10:11:24 +00:00
}
2026-08-06 08:05:19 +00:00
tmp3 = tmp4;
2026-07-23 10:11:24 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp3;
2026-07-23 10:11:24 +00:00
}
const size = fn(2);
const result = size.fileFinishedImporting("modules/user_profile/hooks/useDisplayableBoardWidgets.tsx");
2026-07-23 10:11:24 +00:00
export const useDisplayableBoardWidgets = function useDisplayableBoardWidgets(id) {
isMobileGameCollectionExperimentEnabled = isMobileGameCollectionExperimentEnabled(9165).useIsMobileGameCollectionExperimentEnabled("UserProfileWidgetsBoard");
2026-08-24 06:08:38 +00:00
const tmp2 = useUserProfileWidgetsDefault(id);
2026-07-23 10:11:24 +00:00
importDefault = tmp2;
const items = [isMobileGameCollectionExperimentEnabled, tmp2];
return noop.useMemo(() => {
2026-07-23 10:11:24 +00:00
if (isMobileGameCollectionExperimentEnabled) {
let found = closure_1.filter(isNonEmptyBoardWidget);
2026-07-23 10:11:24 +00:00
} else {
found = [];
}
return found;
}, items);
};