decord/source/modules/client_themes/SavedCustomThemeActionCreators.tsx
github-actions 03cf168fbc chore: update source for alpha 347.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
2026-09-17 08:17:09 +00:00

48 lines
1.7 KiB
TypeScript

// Module ID: 15381
// Function ID: 15382
// Name: SavedCustomThemeActionCreators
// Dependencies: [4572, 1074, 573, 1271, 2]
// Exports: fetchUserCustomThemes
// Module 15381 (SavedCustomThemeActionCreators)
import DispatcherDefault from "Dispatcher" /* 573 */;
import HTTPUtils from "HTTPUtils" /* 1271 */;
import SavedCustomThemeStore from "SavedCustomThemeStore" /* 4572 */;
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 });
});
}
};