decord/source/modules/welcome_screen/WelcomeScreenActionCreators.tsx

140 lines
4.5 KiB
TypeScript
Raw Normal View History

// Module ID: 12660
// Function ID: 12661
2026-07-20 16:05:17 +00:00
// Name: _fetchWelcomeScreen
// Dependencies: [5, 1074, 573, 1272, 2]
2026-07-20 16:05:17 +00:00
// Exports: clearWelcomeScreenSettings, fetchWelcomeScreen, resetWelcomeScreen, saveWelcomeScreen, updateSettings, welcomeScreenViewed
// Module 12660 (_fetchWelcomeScreen)
import dispatcherDefault from "dispatcher" /* 573 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "asyncGeneratorStep" /* 5 */;
import { Endpoints } from "ME" /* 1074 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function _fetchWelcomeScreen() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c5 = 0;
c6 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
2026-08-24 06:08:38 +00:00
dependencyMap = tmp3;
closure_1_1(closure_1_2[2]).dispatch({ type: "WELCOME_SCREEN_FETCH_START" });
c4 = 1;
const HTTP = callback(closure_1_2[3]).HTTP;
obj1 = { url: null, oldFormErrors: true, rejectWithError: true };
2026-08-04 21:03:28 +00:00
obj1[0] = c4.GUILD_WELCOME_SCREEN(callback);
yield HTTP.get(obj1);
c4 = 0;
let obj4 = lib(573);
2026-08-04 21:03:28 +00:00
obj4.dispatch({ type: "WELCOME_SCREEN_FETCH_FAIL" });
2026-08-08 06:10:11 +00:00
lib = yield "HermesInternal";
const obj = lib(573);
2026-08-04 21:03:28 +00:00
obj4 = { type: "WELCOME_SCREEN_FETCH_SUCCESS", guildId: null, welcomeScreen: null };
obj4[1] = callback;
obj4[2] = lib.body;
obj.dispatch(obj4);
c4 = 0;
return lib.body;
2026-07-29 08:29:29 +00:00
})();
});
2026-08-24 06:08:38 +00:00
closure_5 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _saveWelcomeScreen() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
c6 = 0;
c7 = 0;
c5 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, arg1) {
2026-08-24 06:08:38 +00:00
closure_3 = tmp3;
lib(closure_1_2[2]).dispatch({ type: "WELCOME_SCREEN_SUBMIT" });
c5 = 1;
const HTTP = callback(closure_1_2[3]).HTTP;
obj1 = { url: null, body: null, oldFormErrors: true, rejectWithError: true };
obj1[0] = closure_1_4.GUILD_WELCOME_SCREEN(callback);
2026-08-04 21:03:28 +00:00
({ description: obj10[0], channels: obj10[1], enabled: obj10[2] } = lib);
obj1[1] = { description: null, welcome_channels: null, enabled: null };
yield HTTP.patch(obj1);
if (1 === tmp7) {
c5 = 0;
const obj3 = lib(573);
2026-08-04 21:03:28 +00:00
obj3.dispatch({ type: "WELCOME_SCREEN_SUBMIT_FAILURE" });
2026-08-24 06:08:38 +00:00
c7 = 3;
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
2026-07-29 08:29:29 +00:00
c7 = 3;
2026-08-04 21:03:28 +00:00
throw arg1;
} else if (arg0 !== 2) {
lib = arg1;
const obj = lib(573);
2026-08-04 21:03:28 +00:00
const obj4 = { type: "WELCOME_SCREEN_SUBMIT_SUCCESS", guildId: null, welcomeScreen: null };
obj4[1] = callback;
obj4[2] = lib.body;
obj.dispatch(obj4);
c5 = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
c5 = 0;
return arg1;
2026-07-29 08:29:29 +00:00
})();
});
2026-08-24 06:08:38 +00:00
closure_6 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/welcome_screen/WelcomeScreenActionCreators.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const welcomeScreenViewed = function welcomeScreenViewed(closure_0) {
2026-07-20 16:05:17 +00:00
let flag = arg1;
if (arg1 === undefined) {
flag = false;
}
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-29 08:29:29 +00:00
obj = { type: "WELCOME_SCREEN_VIEW", guildId: closure_0, isLurking: flag };
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
};
2026-07-29 08:29:29 +00:00
export const fetchWelcomeScreen = function fetchWelcomeScreen(closure_0) {
const self = this;
const apply = _fetchWelcomeScreen.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
export const resetWelcomeScreen = function resetWelcomeScreen() {
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch({ type: "WELCOME_SCREEN_SETTINGS_RESET" });
2026-07-20 16:05:17 +00:00
};
export const clearWelcomeScreenSettings = function clearWelcomeScreenSettings() {
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch({ type: "WELCOME_SCREEN_SETTINGS_CLEAR" });
2026-07-20 16:05:17 +00:00
};
export const updateSettings = function updateSettings(settings) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-20 16:05:17 +00:00
obj = { type: "WELCOME_SCREEN_SETTINGS_UPDATE", settings };
obj.dispatch(obj);
};
export const saveWelcomeScreen = function saveWelcomeScreen() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _saveWelcomeScreen.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};