Files
discord-decomp/sources/modules/stickers/useLoadGuildStickerWithCreator.tsx
T
2026-07-28 01:06:53 +03:00

209 lines
11 KiB
TypeScript

/* Metro module 15918; source: modules/stickers/useLoadGuildStickerWithCreator.tsx; dependencies: [5, 57, 31, 1878, 6584, 566, 11050, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import GuildStickersStore from './GuildStickersStore.tsx'; /* Metro dependency 6584 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
function _fun122789(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#122789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16126:6, offset: 0x02575160, size: 181 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/stickers/useLoadGuildStickerWithCreator.tsx');
exports.default = useLoadGuildStickersWithCreator;
function useLoadGuildStickersWithCreator(a0) { // fn#122790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16126:241, offset: 0x02575215, size: 187 bytes, params: 2, frame: 18
var r0;
let env0_0 = a0;
let [property, env0_1] = Module00057(ReactModule.useState('loading'), 2);
const useStateFromStores = FluxModule.useStateFromStores;
let object = [GuildStickersStore];
const stickersByGuildId = Reflect.apply(useStateFromStores, FluxModule, [object, _fun122791]);
ReactModule.useEffect(function() {
var AbortController = global.AbortController;
var value2 = new AbortController();
var env0_0 = value2;
var env0_1 = value2.signal;
_fun122793()();
return _fun122797;
}, [a0]);
if (property === 'success') {
object = {status: property};
object.stickers = stickersByGuildId.map(function(a0) {
var r0;
var object;
var value = a0;
var value3 = UserStore.getUser(value.user_id);
if (value3 == null) {
r0 = value;
} else {
object = {};
copyDataProperties(object, value, value3);
object['user'] = value3;
r0 = object;
}
return r0;
});
r0 = object;
} else {
r0 = {status: property};
}
return r0;
function _fun122791() { // fn#122791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16126:370, offset: 0x025752d0, size: 27 bytes, params: 1, frame: 11
return GuildStickersStore.getStickersByGuildId(env0_0);
}
function _fun122792() { // fn#122792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16126:422, offset: 0x025752eb, size: 70 bytes, params: 1, frame: 10
const AbortController = global.AbortController;
const env0_1 = new AbortController().signal;
_fun122793()();
return _fun122797;
function _fun122793() { // fn#122793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16126:466, offset: 0x02575331, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_2(_fun122795);
return _fun122796;
function* _fun122795() { // fn#122795, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16126:486, offset: 0x02575360, size: 129 bytes, params: 1, frame: 17
var binding;
var binding2;
var property;
var fetchGuildStickersWithCreator;
var value5;
var error;
if (true) {
value = environment.__proto__.__proto__.__proto__.__proto__;
try {
binding = env4_0;
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
return undefined;
}
try {
binding2 = env4_1;
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
return undefined;
}
try {
property = binding2[6];
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
return undefined;
}
try {
value = binding(property);
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
return undefined;
}
try {
fetchGuildStickersWithCreator = value.fetchGuildStickersWithCreator;
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
return undefined;
}
try {
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
return undefined;
}
try {
binding = env2_1;
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
return undefined;
}
try {
value = Reflect.apply(fetchGuildStickersWithCreator, value, [require, binding]);
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
return undefined;
}
yield value;
try {
value = undefined;
value5 = false;
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
return undefined;
}
if (value5) {
return value;
}
try {
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
return undefined;
}
try {
dependencyMap('success');
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
return undefined;
}
try {
env2_0 = null;
} catch (error) {
value = environment.__proto__.__proto__.__proto__;
dependencyMap('error');
value = environment.__proto__.__proto__;
env2_0 = null;
}
}
}
function _fun122796() { // fn#122796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16126:609, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
function _fun122797() { // fn#122797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16126:666, offset: 0x025753e1, size: 43 bytes, params: 1, frame: 11
env1_1('loading');
const binding = env0_0;
if (binding != null) {
binding.abort();
}
}
}
}
}
global.__d(_fun122789, 15918, [5, 57, 31, 1878, 6584, 566, 11050,
2]) /* metro module 15918, dependencies: [5, 57, 31, 1878, 6584, 566, 11050, 2] */;