decord/source/modules/guild_onboarding_home/getNextResourceChannel.tsx

43 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11500
// Function ID: 11501
2026-07-20 16:05:17 +00:00
// Name: getCurrentAndNextResourceChannel
2026-08-24 06:08:38 +00:00
// Dependencies: [5053, 589, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, usePreviousAndNextResourceChannel
2026-08-24 06:08:38 +00:00
// Module 11500 (getCurrentAndNextResourceChannel)
import closure_2 from "handleSettingsLoadSuccess" /* 5053 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
const result = require("set").fileFinishedImporting("modules/guild_onboarding_home/getNextResourceChannel.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default function getCurrentAndNextResourceChannel(closure_0) {
closure_0 = arg1;
resourceChannels = resourceChannels.getResourceChannels(closure_0);
2026-07-23 10:11:24 +00:00
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-08-24 06:08:38 +00:00
dependencyMap = id;
const items = [closure_2];
const stateFromStores = _require(589).useStateFromStores(items, () => closure_1_2.getResourceChannels(closure_0));
2026-07-23 10:11:24 +00:00
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
};