decord/source/modules/stickers/useLoadGuildStickerWithCreator.tsx

96 lines
2.8 KiB
TypeScript
Raw Normal View History

2026-08-27 16:17:25 +00:00
// Module ID: 17073
// Function ID: 17074
2026-07-20 16:05:17 +00:00
// Name: useLoadGuildStickersWithCreator
2026-08-27 16:17:25 +00:00
// Dependencies: [5, 32, 19, 1922, 5397, 589, 10299, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-27 16:17:25 +00:00
// Module 17073 (useLoadGuildStickersWithCreator)
2026-08-24 06:08:38 +00:00
import closure_2 from "asyncGeneratorStep" /* 5 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import closure_5 from "mergeGuildAvatar" /* 1922 */;
2026-08-27 16:17:25 +00:00
import closure_6 from "parseServerGuildSticker" /* 5397 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/stickers/useLoadGuildStickerWithCreator.tsx");
2026-07-20 16:05:17 +00:00
export default function useLoadGuildStickersWithCreator(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-29 08:29:29 +00:00
[tmp2, dependencyMap] = callback(React.useState("loading"), 2);
let obj = _require(589);
2026-08-24 06:08:38 +00:00
const items = [closure_6];
const stateFromStores = obj.useStateFromStores(items, () => closure_1_6.getStickersByGuildId(closure_0));
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
const effect = React.useEffect(() => {
function _fetch() {
2026-07-29 08:29:29 +00:00
const self = this;
2026-08-24 06:08:38 +00:00
const tmp = closure_2_2(function*() {
c0 = tmp3;
c3 = 1;
obj1 = closure_2_0(closure_2_1[6]);
yield obj1.fetchGuildStickersWithCreator(closure_1_0, v0);
2026-08-04 21:03:28 +00:00
if (1 === tmp7) {
c3 = 0;
v0("error");
c0 = null;
2026-08-24 06:08:38 +00:00
c4 = 3;
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
2026-07-29 08:29:29 +00:00
c4 = 3;
2026-08-04 21:03:28 +00:00
throw arg1;
} else if (arg0 !== 2) {
v0("success");
c0 = null;
c3 = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
c3 = 0;
return arg1;
2026-07-29 08:29:29 +00:00
});
2026-08-24 06:08:38 +00:00
closure_2 = 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
}
const abortController = new AbortController();
const signal = abortController.signal;
2026-07-23 10:11:24 +00:00
(function fetch() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fetch.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-23 10:11:24 +00:00
})();
2026-07-20 16:05:17 +00:00
return () => {
signal("loading");
2026-07-29 08:29:29 +00:00
if (abortController != null) {
2026-07-20 16:05:17 +00:00
abortController.abort();
}
};
}, items1);
2026-07-29 08:29:29 +00:00
if ("success" === tmp2) {
obj = { status: null, stickers: null };
obj[0] = tmp2;
obj[1] = stateFromStores.map((user_id) => {
user = user.getUser(user_id.user_id);
let tmp2 = user_id;
if (null != user) {
const obj = {};
const merged = Object.assign(user_id);
obj.user = user;
tmp2 = obj;
}
return tmp2;
});
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { status: null };
obj[0] = tmp2;
2026-07-20 16:05:17 +00:00
}
return obj;
};