decord/source/modules/user_profile/WidgetActionCreators.tsx

95 lines
3.1 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 5637
2026-07-27 11:26:19 +00:00
// Function ID: 48232
2026-07-25 08:10:48 +00:00
// Dependencies: [5, 1850, 653, 686, 507, 1184, 2]
2026-07-20 16:05:17 +00:00
2026-07-25 08:10:48 +00:00
// Module 5637
2026-07-23 10:11:24 +00:00
import isNonEmptyString from "isNonEmptyString";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { Endpoints } from "ME";
const require = arg1;
const result = require("ME").fileFinishedImporting("modules/user_profile/WidgetActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default {
setPendingWidgets(items) {
2026-07-23 10:11:24 +00:00
let obj = importDefault(686);
2026-07-20 16:05:17 +00:00
obj = { type: "WIDGET_PENDING_SET", widgets: items };
obj.dispatch(obj);
},
savePendingWidgets(arg0) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
return callback(async () => {
2026-07-23 10:11:24 +00:00
const currentUser = outer2_4.getCurrentUser();
2026-07-20 16:05:17 +00:00
let id;
if (null != currentUser) {
id = currentUser.id;
}
if (null != id) {
2026-07-23 10:11:24 +00:00
let obj = outer2_1(outer2_2[3]);
2026-07-20 16:05:17 +00:00
obj = { type: "WIDGET_PENDING_SAVE_START" };
obj.dispatch(obj);
2026-07-23 10:11:24 +00:00
const mapped = outer1_0.map((toSubmission) => toSubmission.toSubmission());
const HTTP = callback(outer2_2[4]).HTTP;
obj = { url: outer2_5.USER_PROFILE_WIDGETS };
2026-07-20 16:05:17 +00:00
const obj1 = { widgets: mapped };
obj.body = obj1;
obj.oldFormErrors = true;
obj.rejectWithError = true;
const tmp11 = yield HTTP.put(obj);
const obj2 = { type: "WIDGET_PENDING_SAVE_SUCCESS", userId: id, widgets: tmp11.body.widgets };
2026-07-23 10:11:24 +00:00
outer2_1(outer2_2[3]).dispatch(obj2);
2026-07-20 16:05:17 +00:00
return tmp11.body;
}
})();
},
clearPendingWidgets() {
2026-07-23 10:11:24 +00:00
importDefault(686).dispatch({ type: "WIDGET_PENDING_CLEAR" });
2026-07-20 16:05:17 +00:00
},
fetchSuggestedGames() {
return callback(async () => {
2026-07-23 10:11:24 +00:00
let obj = outer2_1(outer2_2[3]);
2026-07-20 16:05:17 +00:00
obj.dispatch({ type: "WIDGET_SUGGESTED_FETCH_START" });
2026-07-23 10:11:24 +00:00
const HTTP = outer2_0(outer2_2[4]).HTTP;
obj = { url: outer2_5.USER_PROFILE_SUGGESTED_GAMES, rejectWithError: true };
2026-07-20 16:05:17 +00:00
const tmp2 = yield HTTP.get(obj);
const body = tmp2.body;
let suggested_games;
if (null != body) {
suggested_games = body.suggested_games;
}
let tmp6 = tmp5;
if (null != suggested_games) {
const body2 = tmp3.body;
let prop;
if (null != body2) {
prop = body2.suggested_wishlist_games;
}
tmp6 = null != prop;
}
if (!tmp6) {
2026-07-23 10:11:24 +00:00
outer2_1(outer2_2[5]).captureMessage("Suggested games or wishlist games not found");
const obj3 = outer2_1(outer2_2[5]);
2026-07-20 16:05:17 +00:00
}
obj = { type: "WIDGET_SUGGESTED_FETCH_SUCCESS" };
const body3 = tmp3.body;
let suggested_games1;
if (null != body3) {
suggested_games1 = body3.suggested_games;
}
obj.suggestedGamesIds = null != suggested_games1 ? suggested_games1 : [];
const body4 = tmp2.body;
let prop1;
if (null != body4) {
prop1 = body4.suggested_wishlist_games;
}
obj.suggestedWishlistGamesIds = null != prop1 ? prop1 : [];
2026-07-23 10:11:24 +00:00
outer2_1(outer2_2[3]).dispatch(obj);
2026-07-20 16:05:17 +00:00
})();
},
removeGameFromSuggestedGames(applicationId) {
2026-07-23 10:11:24 +00:00
let obj = importDefault(686);
2026-07-20 16:05:17 +00:00
obj = { type: "WIDGET_SUGGESTED_REMOVE_GAME", applicationId };
obj.dispatch(obj);
}
};