decord/source/modules/guild_onboarding_home/getNextResourceChannel.tsx

43 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 11375
// Function ID: 88370
2026-07-20 16:05:17 +00:00
// Name: getCurrentAndNextResourceChannel
2026-07-25 08:10:48 +00:00
// Dependencies: [4334, 566, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, usePreviousAndNextResourceChannel
2026-07-27 11:26:19 +00:00
// Module 11375 (getCurrentAndNextResourceChannel)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
const require = arg1;
const result = require("set").fileFinishedImporting("modules/guild_onboarding_home/getNextResourceChannel.tsx");
2026-07-20 16:05:17 +00:00
export default function getCurrentAndNextResourceChannel(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1;
resourceChannels = resourceChannels.getResourceChannels(arg0);
const findIndexResult = resourceChannels.findIndex((channelId) => channelId.channelId === closure_0);
2026-07-20 16:05:17 +00:00
if (findIndexResult < 0) {
2026-07-23 10:11:24 +00:00
let items = [null, null];
2026-07-20 16:05:17 +00:00
} else {
items = [resourceChannels[findIndexResult], resourceChannels[(findIndexResult + 1) % resourceChannels.length]];
}
return items;
};
export const usePreviousAndNextResourceChannel = function usePreviousAndNextResourceChannel(guild_id, id) {
2026-07-23 10:11:24 +00:00
const _require = guild_id;
2026-07-20 16:05:17 +00:00
const dependencyMap = id;
2026-07-23 10:11:24 +00:00
const items = [_isNativeReflectConstruct];
const stateFromStores = _require(566).useStateFromStores(items, () => outer1_2.getResourceChannels(closure_0));
const findIndexResult = stateFromStores.findIndex((channelId) => channelId.channelId === closure_1);
2026-07-20 16:05:17 +00:00
if (findIndexResult >= 0) {
if (stateFromStores.length > 1) {
if (2 === stateFromStores.length) {
2026-07-23 10:11:24 +00:00
const items1 = [null, stateFromStores[1 - findIndexResult]];
2026-07-20 16:05:17 +00:00
let items2 = items1;
} else {
items2 = [stateFromStores[(findIndexResult - 1) % stateFromStores.length], stateFromStores[(findIndexResult + 1) % stateFromStores.length]];
}
}
return items2;
}
2026-07-23 10:11:24 +00:00
items2 = [null, null];
2026-07-20 16:05:17 +00:00
};