2026-09-12 13:45:10 +00:00
|
|
|
// Module ID: 15349
|
|
|
|
|
// Function ID: 15350
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: SavedCustomThemeActionCreators
|
2026-09-12 13:45:10 +00:00
|
|
|
// Dependencies: [4569, 1074, 573, 1272, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: fetchUserCustomThemes
|
|
|
|
|
|
2026-09-12 13:45:10 +00:00
|
|
|
// Module 15349 (SavedCustomThemeActionCreators)
|
2026-09-10 05:38:07 +00:00
|
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
|
|
|
import HTTPUtils from "HTTPUtils" /* 1272 */;
|
2026-09-12 13:45:10 +00:00
|
|
|
import SavedCustomThemeStore from "SavedCustomThemeStore" /* 4569 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
require = fn;
|
|
|
|
|
const Endpoints = fn(1074).Endpoints;
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/client_themes/SavedCustomThemeActionCreators.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export const fetchUserCustomThemes = function fetchUserCustomThemes() {
|
2026-09-10 05:38:07 +00:00
|
|
|
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);
|
2026-07-20 16:05:17 +00:00
|
|
|
value.then((body) => {
|
|
|
|
|
body = body.body;
|
|
|
|
|
let custom_themes;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (body != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
custom_themes = body.custom_themes;
|
|
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
if (custom_themes == null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
custom_themes = [];
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
DispatcherDefault.dispatch({ type: "SAVED_CUSTOM_THEMES_FETCH_SUCCESS", themes: custom_themes });
|
2026-07-20 16:05:17 +00:00
|
|
|
}).catch((error) => {
|
2026-09-10 05:38:07 +00:00
|
|
|
DispatcherDefault.dispatch({ type: "SAVED_CUSTOM_THEMES_FETCH_FAILURE", error });
|
2026-07-20 16:05:17 +00:00
|
|
|
});
|
|
|
|
|
const nextPromise = value.then((body) => {
|
|
|
|
|
body = body.body;
|
|
|
|
|
let custom_themes;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (body != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
custom_themes = body.custom_themes;
|
|
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
if (custom_themes == null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
custom_themes = [];
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
DispatcherDefault.dispatch({ type: "SAVED_CUSTOM_THEMES_FETCH_SUCCESS", themes: custom_themes });
|
2026-07-20 16:05:17 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|