94 lines
3.1 KiB
TypeScript
94 lines
3.1 KiB
TypeScript
// Module ID: 5637
|
|
// Function ID: 48232
|
|
// Dependencies: [5, 1850, 653, 686, 507, 1184, 2]
|
|
|
|
// Module 5637
|
|
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");
|
|
|
|
export default {
|
|
setPendingWidgets(items) {
|
|
let obj = importDefault(686);
|
|
obj = { type: "WIDGET_PENDING_SET", widgets: items };
|
|
obj.dispatch(obj);
|
|
},
|
|
savePendingWidgets(arg0) {
|
|
let closure_0 = arg0;
|
|
return callback(async () => {
|
|
const currentUser = outer2_4.getCurrentUser();
|
|
let id;
|
|
if (null != currentUser) {
|
|
id = currentUser.id;
|
|
}
|
|
if (null != id) {
|
|
let obj = outer2_1(outer2_2[3]);
|
|
obj = { type: "WIDGET_PENDING_SAVE_START" };
|
|
obj.dispatch(obj);
|
|
const mapped = outer1_0.map((toSubmission) => toSubmission.toSubmission());
|
|
const HTTP = callback(outer2_2[4]).HTTP;
|
|
obj = { url: outer2_5.USER_PROFILE_WIDGETS };
|
|
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 };
|
|
outer2_1(outer2_2[3]).dispatch(obj2);
|
|
return tmp11.body;
|
|
}
|
|
})();
|
|
},
|
|
clearPendingWidgets() {
|
|
importDefault(686).dispatch({ type: "WIDGET_PENDING_CLEAR" });
|
|
},
|
|
fetchSuggestedGames() {
|
|
return callback(async () => {
|
|
let obj = outer2_1(outer2_2[3]);
|
|
obj.dispatch({ type: "WIDGET_SUGGESTED_FETCH_START" });
|
|
const HTTP = outer2_0(outer2_2[4]).HTTP;
|
|
obj = { url: outer2_5.USER_PROFILE_SUGGESTED_GAMES, rejectWithError: true };
|
|
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) {
|
|
outer2_1(outer2_2[5]).captureMessage("Suggested games or wishlist games not found");
|
|
const obj3 = outer2_1(outer2_2[5]);
|
|
}
|
|
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 : [];
|
|
outer2_1(outer2_2[3]).dispatch(obj);
|
|
})();
|
|
},
|
|
removeGameFromSuggestedGames(applicationId) {
|
|
let obj = importDefault(686);
|
|
obj = { type: "WIDGET_SUGGESTED_REMOVE_GAME", applicationId };
|
|
obj.dispatch(obj);
|
|
}
|
|
};
|