decord/source/modules/client_themes/SavedCustomThemeActionCreators.tsx

56 lines
1.8 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 14215
// Function ID: 109354
2026-07-20 16:05:17 +00:00
// Name: fetchUserCustomThemes
2026-07-25 08:10:48 +00:00
// Dependencies: [4065, 653, 686, 507, 2]
2026-07-20 16:05:17 +00:00
// Exports: fetchUserCustomThemes
2026-07-27 11:26:19 +00:00
// Module 14215 (fetchUserCustomThemes)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { Endpoints } from "ME";
const require = arg1;
const result = require("dispatcher").fileFinishedImporting("modules/client_themes/SavedCustomThemeActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export const fetchUserCustomThemes = function fetchUserCustomThemes() {
if (!fetching.isFetching()) {
2026-07-23 10:11:24 +00:00
let obj = importDefault(686);
2026-07-20 16:05:17 +00:00
obj = { type: "SAVED_CUSTOM_THEMES_FETCH_START" };
obj.dispatch(obj);
2026-07-23 10:11:24 +00:00
const HTTP = require(507) /* _isNativeReflectConstruct */.HTTP;
obj = { url: Endpoints.USERS_ME_CUSTOM_THEMES, oldFormErrors: true, rejectWithError: true };
2026-07-20 16:05:17 +00:00
const value = HTTP.get(obj);
value.then((body) => {
2026-07-23 10:11:24 +00:00
let obj = outer1_1(outer1_2[2]);
2026-07-20 16:05:17 +00:00
obj = { type: "SAVED_CUSTOM_THEMES_FETCH_SUCCESS" };
body = body.body;
let custom_themes;
if (null != body) {
custom_themes = body.custom_themes;
}
if (null == custom_themes) {
custom_themes = [];
}
obj.themes = custom_themes;
obj.dispatch(obj);
}).catch((error) => {
2026-07-23 10:11:24 +00:00
let obj = outer1_1(outer1_2[2]);
2026-07-20 16:05:17 +00:00
obj = { type: "SAVED_CUSTOM_THEMES_FETCH_FAILURE", error };
obj.dispatch(obj);
});
const nextPromise = value.then((body) => {
2026-07-23 10:11:24 +00:00
let obj = outer1_1(outer1_2[2]);
2026-07-20 16:05:17 +00:00
obj = { type: "SAVED_CUSTOM_THEMES_FETCH_SUCCESS" };
body = body.body;
let custom_themes;
if (null != body) {
custom_themes = body.custom_themes;
}
if (null == custom_themes) {
custom_themes = [];
}
obj.themes = custom_themes;
obj.dispatch(obj);
});
}
};