decord/source/modules/stickers/useLoadGuildStickerWithCreator.tsx

144 lines
4.2 KiB
TypeScript
Raw Normal View History

2026-07-31 08:44:05 +00:00
// Module ID: 16433
// Function ID: 16434
2026-07-20 16:05:17 +00:00
// Name: useLoadGuildStickersWithCreator
2026-07-31 08:44:05 +00:00
// Dependencies: [5, 32, 19, 1874, 5097, 589, 9632, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-31 08:44:05 +00:00
// Module 16433 (useLoadGuildStickersWithCreator)
2026-07-23 10:11:24 +00:00
import initialize from "initialize";
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import noop from "noop";
import mergeGuildAvatar from "mergeGuildAvatar";
import parseServerGuildSticker from "parseServerGuildSticker";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
const result = require("noop").fileFinishedImporting("modules/stickers/useLoadGuildStickerWithCreator.tsx");
2026-07-20 16:05:17 +00:00
export default function useLoadGuildStickersWithCreator(arg0) {
2026-07-29 08:29:29 +00:00
let dependencyMap;
let tmp2;
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);
const items = [parseServerGuildSticker];
2026-07-23 10:11:24 +00:00
const stateFromStores = obj.useStateFromStores(items, () => outer1_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;
const tmp = outer2_2(function*() {
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
c4 = 2;
if (0 === v0) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let c0 = tmp3;
let c3 = 1;
let obj1 = outer2_0(outer2_1[6]);
v0 = 2;
c4 = 1;
obj1 = { value: null, done: false };
obj1[0] = obj1.fetchGuildStickersWithCreator(outer1_0, v0);
return obj1;
}
} else {
if (1 === tmp7) {
c3 = 0;
v0("error");
c0 = null;
c4 = 3;
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 !== 2) {
v0("success");
c0 = null;
c3 = 0;
}
c3 = 0;
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
} catch (tmp19) {
let initialize = tmp19;
if (tmp4 === c3) {
c4 = tmp2;
throw tmp19;
} else {
v0 = tmp;
}
}
}
});
const _fetch = tmp;
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;
};