65 lines
3.6 KiB
TypeScript
65 lines
3.6 KiB
TypeScript
/* Metro module 11805; source: modules/guild_onboarding_home/getNextResourceChannel.tsx; dependencies: [4869, 566, 2] */
|
|
import GuildOnboardingHomeSettingsStore from './GuildOnboardingHomeSettingsStore.tsx'; /* Metro dependency 4869 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
|
|
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});
|
|
(FileImportTrackerModule).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 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);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun90407, 11805, [4869, 566, 2]) /* metro module 11805, dependencies: [4869, 566, 2] */;
|