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

45 lines
1.5 KiB
TypeScript
Raw Normal View History

2026-08-27 16:17:25 +00:00
// Module ID: 12413
// Function ID: 12414
2026-07-23 10:11:24 +00:00
// Name: isNonEmptyBoardWidget
2026-08-27 16:17:25 +00:00
// Dependencies: [19, 7311, 7308, 7301, 12414, 12415, 2]
2026-07-23 10:11:24 +00:00
// Exports: useDisplayableBoardWidgets
2026-08-27 16:17:25 +00:00
// Module 12413 (isNonEmptyBoardWidget)
import toSubmission from "toSubmission" /* 7311 */;
import useUserProfileWidgetsDefault from "useUserProfileWidgets" /* 12415 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-23 10:11:24 +00:00
function isNonEmptyBoardWidget(games) {
2026-08-24 06:08:38 +00:00
let tmp3 = games instanceof toSubmission.ApplicationWidget;
2026-07-29 08:29:29 +00:00
if (!tmp3) {
2026-08-27 16:17:25 +00:00
let tmp4 = games instanceof tmp(7308).UserProfilePersonalWidget;
2026-08-06 08:05:19 +00:00
if (!tmp4) {
2026-08-27 16:17:25 +00:00
let isGameWidgetResult = tmp(7301).isGameWidget(games);
2026-08-06 08:05:19 +00:00
if (isGameWidgetResult) {
isGameWidgetResult = games.games.length > 0;
}
tmp4 = isGameWidgetResult;
2026-08-27 16:17:25 +00:00
const tmpResult = tmp(7301);
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
}
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/user_profile/hooks/useDisplayableBoardWidgets.tsx");
2026-07-23 10:11:24 +00:00
export const useDisplayableBoardWidgets = function useDisplayableBoardWidgets(id) {
2026-08-27 16:17:25 +00:00
isMobileGameCollectionExperimentEnabled = isMobileGameCollectionExperimentEnabled(12414).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 React.useMemo(() => {
if (isMobileGameCollectionExperimentEnabled) {
2026-08-24 06:08:38 +00:00
let found = closure_1.filter(closure_1_4);
2026-07-23 10:11:24 +00:00
} else {
found = [];
}
return found;
}, items);
};