decord/source/modules/client_themes/SavedCustomThemeActionCreators.tsx
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

48 lines
1.7 KiB
TypeScript

// Module ID: 15376
// Function ID: 15377
// Name: SavedCustomThemeActionCreators
// Dependencies: [4570, 1074, 573, 1271, 2]
// Exports: fetchUserCustomThemes
// Module 15376 (SavedCustomThemeActionCreators)
import DispatcherDefault from "Dispatcher" /* 573 */;
import HTTPUtils from "HTTPUtils" /* 1271 */;
import SavedCustomThemeStore from "SavedCustomThemeStore" /* 4570 */;
require = fn;
const Endpoints = fn(1074).Endpoints;
const size = fn(2);
const result = size.fileFinishedImporting("modules/client_themes/SavedCustomThemeActionCreators.tsx");
export const fetchUserCustomThemes = function fetchUserCustomThemes() {
if (!SavedCustomThemeStore.isFetching()) {
DispatcherDefault.dispatch({ type: "SAVED_CUSTOM_THEMES_FETCH_START" });
const HTTP = HTTPUtils.HTTP;
const obj2 = { url: Endpoints.USERS_ME_CUSTOM_THEMES, oldFormErrors: true, rejectWithError: true };
value = HTTP.get(obj2);
value.then((body) => {
body = body.body;
let custom_themes;
if (body != null) {
custom_themes = body.custom_themes;
}
if (custom_themes == null) {
custom_themes = [];
}
DispatcherDefault.dispatch({ type: "SAVED_CUSTOM_THEMES_FETCH_SUCCESS", themes: custom_themes });
}).catch((error) => {
DispatcherDefault.dispatch({ type: "SAVED_CUSTOM_THEMES_FETCH_FAILURE", error });
});
const nextPromise = value.then((body) => {
body = body.body;
let custom_themes;
if (body != null) {
custom_themes = body.custom_themes;
}
if (custom_themes == null) {
custom_themes = [];
}
DispatcherDefault.dispatch({ type: "SAVED_CUSTOM_THEMES_FETCH_SUCCESS", themes: custom_themes });
});
}
};