decord/source/modules/applications/useGuildApplication.tsx

115 lines
3.4 KiB
TypeScript
Raw Normal View History

// Module ID: 17890
// Function ID: 17891
2026-07-20 16:05:17 +00:00
// Name: useGuildApplication
// Dependencies: [5, 32, 19, 4866, 504, 7273, 4538, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 17890 (useGuildApplication)
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
import ApplicationStore from "ApplicationStore" /* 4866 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/applications/useGuildApplication.tsx");
2026-07-20 16:05:17 +00:00
export default function useGuildApplication(arg0, arg1) {
_require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
const items = [closure_6];
application = require("initialize").useStateFromStores(items, () => ApplicationStore.getGuildApplication(closure_0, closure_1));
let obj = require("initialize");
[tmp3, asyncGeneratorStep] = first.useState(null == application);
const error = _slicedToArray(first.useState(), 2);
_slicedToArray = error[1];
[first, closure_6] = first.useState(false);
2026-07-20 16:05:17 +00:00
const items1 = [application, arg1, arg0];
const callback = first.useCallback(asyncGeneratorStep(async (arg0, value) => {
2026-07-29 08:29:29 +00:00
if (c5 === 2) {
c5 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-07-29 08:29:29 +00:00
} else if (tmp7 === 3) {
if (arg0 === 1) {
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
const obj3 = { value, done: true };
return obj3;
2026-07-29 08:29:29 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c5 = 2;
if (0 === c4) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
c5 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c5 = 3;
const obj4 = { value, done: true };
return obj4;
2026-07-29 08:29:29 +00:00
} else {
const type = tmp4;
2026-08-24 06:08:38 +00:00
closure_0 = tmp8;
if (null == application) {
if (null != closure_0) {
closure_6(true);
asyncGeneratorStep(true);
c3 = 2;
const obj5 = { type, includeTeam: true };
c4 = 3;
2026-07-29 08:29:29 +00:00
c5 = 1;
const obj6 = { value: type(tmp41[5]).getApplicationsForGuild(tmp33, obj5), done: false };
return obj6;
2026-07-29 08:29:29 +00:00
}
}
c5 = 3;
}
} else if (1 !== tmp8) {
if (2 === tmp8) {
c3 = 1;
closure_128_0 = tmp41;
const aPIError = new closure_0(tmp41[6]).APIError(closure_128_0);
closure_129_4(aPIError);
2026-07-29 08:29:29 +00:00
} else if (arg0 === 1) {
c5 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c3 = 0;
closure_129_3(false);
2026-07-29 08:29:29 +00:00
c5 = 3;
const obj = { value, done: true };
2026-07-29 08:29:29 +00:00
return obj;
} else {
c3 = 1;
2026-07-29 08:29:29 +00:00
}
c3 = 0;
closure_129_3(false);
2026-07-29 08:29:29 +00:00
}
c3 = 0;
closure_129_3(false);
throw tmp41;
2026-07-29 08:29:29 +00:00
} catch (tmp41) {
if (tmp5 === c3) {
2026-07-29 08:29:29 +00:00
c5 = tmp3;
throw tmp41;
} else if (tmp2 === tmp43) {
c4 = tmp2;
2026-07-29 08:29:29 +00:00
} else {
c4 = tmp;
2026-07-29 08:29:29 +00:00
}
}
}
}), items1);
2026-07-20 16:05:17 +00:00
const items2 = [first, callback];
2026-07-23 10:11:24 +00:00
const effect = first.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (!first) {
callback();
}
}, items2);
return { application, error: error[0], loading };
};