62 lines
3.1 KiB
TypeScript
62 lines
3.1 KiB
TypeScript
/* Metro module 11805; source: modules/guild_onboarding_home/getNextResourceChannel.tsx; dependencies: [4869, 566, 2] */
|
|
function _fun90407(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11991:6, offset: 0x020384e5, size: 127 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const guildOnboardingHomeSettingsStore = importDefault(4869) /* metro dependency 4869: GuildOnboardingHomeSettingsStore */;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_onboarding_home/getNextResourceChannel.tsx');
|
|
exports.default = getCurrentAndNextResourceChannel;
|
|
exports.usePreviousAndNextResourceChannel = usePreviousAndNextResourceChannel;
|
|
}
|
|
|
|
function getCurrentAndNextResourceChannel(a0, a1) { // fn#90408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11991:206, offset: 0x02038564, size: 104 bytes, params: 3, frame: 12
|
|
const env0_0 = a1;
|
|
const resourceChannels = GuildOnboardingHomeSettingsStore.getResourceChannels(a0);
|
|
const index = resourceChannels.findIndex(function({channelId}) {
|
|
return channelId === require;
|
|
});
|
|
return index < 0 ? [null, null] : [resourceChannels[index], resourceChannels[(index + 1) % resourceChannels.length]];
|
|
}
|
|
|
|
function usePreviousAndNextResourceChannel(a0, a1) { // fn#90410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11991:405, offset: 0x020385cc, size: 201 bytes, params: 3, frame: 15
|
|
var r0;
|
|
var length;
|
|
var value2;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const fluxModule = require(566) /* metro dependency 566: flux */;
|
|
const useStateFromStores = fluxModule.useStateFromStores;
|
|
let items2 = [GuildOnboardingHomeSettingsStore];
|
|
const resourceChannels = Reflect.apply(useStateFromStores, fluxModule, [items2, _fun90411]);
|
|
let value = resourceChannels.findIndex(function({channelId}) {
|
|
return channelId === require;
|
|
});
|
|
if (value < 0) {
|
|
r0 = [null, null];
|
|
} else {
|
|
length = resourceChannels.length;
|
|
if (length <= 1) {
|
|
r0 = [null, null];
|
|
} else {
|
|
length = resourceChannels.length;
|
|
if (length === 2) {
|
|
r0 = [null, resourceChannels[1 - value]];
|
|
} else {
|
|
value2 = value - 1;
|
|
length = resourceChannels.length;
|
|
items2 = [resourceChannels[value2 % length]];
|
|
value += 1;
|
|
length = resourceChannels.length;
|
|
items2[1] = resourceChannels[value % length];
|
|
r0 = items2;
|
|
}
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun90411() { // fn#90411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11991:491, offset: 0x02038695, size: 27 bytes, params: 1, frame: 11
|
|
return GuildOnboardingHomeSettingsStore.getResourceChannels(env0_0);
|
|
}
|
|
|