decord/source/modules/launchpad/native/shared/useChannelUnreadBadgeState.tsx

64 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 15704
// Function ID: 15705
2026-07-29 08:29:29 +00:00
// Name: useChannelUnreadBadgeState
2026-08-25 06:04:03 +00:00
// Dependencies: [7138, 4395, 4589, 589, 7141, 2]
2026-07-29 08:29:29 +00:00
// Exports: useBaseChannelUnreadBadgeState, useChannelUnreadBadgeState
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 15704 (useChannelUnreadBadgeState)
import closure_2 from "guildHasCommunity" /* 7138 */;
import closure_3 from "generateOldThreadCutoff" /* 4395 */;
import closure_4 from "updateUserGuildSettingsInternal" /* 4589 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/launchpad/native/shared/useChannelUnreadBadgeState.tsx");
2026-07-20 16:05:17 +00:00
export const useChannelUnreadBadgeState = function useChannelUnreadBadgeState(channel, flag) {
2026-07-23 10:11:24 +00:00
const _require = channel;
2026-08-24 06:08:38 +00:00
dependencyMap = flag;
2026-07-29 08:29:29 +00:00
let obj = _require(589);
2026-08-24 06:08:38 +00:00
const items = [closure_3];
2026-07-29 08:29:29 +00:00
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => {
2026-08-24 06:08:38 +00:00
const obj = { ackMessageId: closure_1_3.ackMessageId(user.id), unread: null, mentionCount: null, isMentionLowImportance: null };
2026-07-29 08:29:29 +00:00
let hasUnreadResult = !closure_1;
if (!closure_1) {
hasUnreadResult = obj2.hasUnread(tmp.id);
}
obj[1] = hasUnreadResult;
2026-08-24 06:08:38 +00:00
obj[2] = closure_1_3.getMentionCount(user.id);
obj[3] = closure_1_3.getIsMentionLowImportance(user.id);
2026-07-29 08:29:29 +00:00
return obj;
});
({ unread, mentionCount, isMentionLowImportance } = stateFromStoresObject);
2026-08-24 06:08:38 +00:00
const items1 = [closure_2];
2026-07-29 08:29:29 +00:00
const items2 = [, ];
({ guild_id: arr3[0], id: arr3[1] } = channel);
2026-08-24 06:08:38 +00:00
const stateFromStores = _require(589).useStateFromStores(items1, () => closure_1_2.shouldIndicateNewChannel(user.guild_id, user.id), items2);
2026-07-29 08:29:29 +00:00
const obj2 = _require(589);
obj = { unread, resolvedUnreadSetting: null, newChannel: null, optInEnabled: null, mentionCount: null, isMentionLowImportance: null };
2026-08-25 06:04:03 +00:00
const optInEnabledForGuild = _require(7141).useOptInEnabledForGuild(channel.guild_id);
const obj3 = _require(7141);
2026-08-24 06:08:38 +00:00
const items3 = [closure_4];
obj[1] = _require(589).useStateFromStores(items3, () => closure_1_4.resolveUnreadSetting(closure_0));
2026-07-29 08:29:29 +00:00
obj[2] = stateFromStores;
obj[3] = optInEnabledForGuild;
obj[4] = mentionCount;
obj[5] = isMentionLowImportance;
2026-07-20 16:05:17 +00:00
return obj;
};
2026-07-29 08:29:29 +00:00
export const useBaseChannelUnreadBadgeState = function useBaseChannelUnreadBadgeState(channel, muted) {
const _require = channel;
2026-08-24 06:08:38 +00:00
dependencyMap = muted;
const items = [closure_3];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStoresObject(items, () => {
2026-08-24 06:08:38 +00:00
const obj = { ackMessageId: closure_1_3.ackMessageId(user.id), unread: null, mentionCount: null, isMentionLowImportance: null };
2026-07-29 08:29:29 +00:00
let hasUnreadResult = !closure_1;
if (!closure_1) {
hasUnreadResult = obj2.hasUnread(tmp.id);
}
obj[1] = hasUnreadResult;
2026-08-24 06:08:38 +00:00
obj[2] = closure_1_3.getMentionCount(user.id);
obj[3] = closure_1_3.getIsMentionLowImportance(user.id);
2026-07-29 08:29:29 +00:00
return obj;
});
};