decord/source/modules/notifications/settings/native/NotificationSettingsMessageUnreadGuildActionSheet.tsx
2026-09-02 09:53:35 +00:00

62 lines
2.9 KiB
TypeScript

// Module ID: 10273
// Function ID: 10274
// Name: NotificationSettingsMessageUnreadGuildActionSheet
// Dependencies: [19, 4701, 673, 4702, 682, 21, 10262, 10274, 1233, 5495, 10255, 5490, 2]
// Exports: default
// Module 10273 (NotificationSettingsMessageUnreadGuildActionSheet)
import noopAll from "noop" /* 19 */;
import NotificationSettingsMessageUnreadActionSheetDefault from "NotificationSettingsMessageUnreadActionSheet" /* 10274 */;
import closure_3 from "updateUserGuildSettingsInternal" /* 4701 */;
import { UserNotificationSettings } from "ME" /* 673 */;
import { UnreadSetting } from "ReadStateTypes" /* 4702 */;
import { GuildNotificationSettingsFlags as closure_6 } from "MAX_FAVORITES" /* 682 */;
import { jsx } from "jsxProd" /* 21 */;
const require = arg1;
noopAll;
let result = require("set").fileFinishedImporting("modules/notifications/settings/native/NotificationSettingsMessageUnreadGuildActionSheet.tsx");
export default function NotificationSettingsMessageUnreadGuildActionSheet(guildId) {
const _require = guildId;
let obj = _require(10262);
const guildPresetSettings = obj.useGuildPresetSettings(guildId.guildId);
({ unread, notification } = guildPresetSettings);
let stringResult;
if (notification === UserNotificationSettings.ALL_MESSAGES) {
const intl = tmp(1233).intl;
stringResult = intl.string(tmp(1233).t.eP8yWU);
}
obj = {
disabledMentionOnlyWithReason: stringResult,
value: unread,
onChange(ONLY_MENTIONS) {
const guildFlags = closure_1_3.getGuildFlags(guildId.guildId);
let obj = closure_1_1(closure_1_2[9]);
if (ONLY_MENTIONS === closure_1_5.ALL_MESSAGES) {
let UNREADS_ONLY_MENTIONS = closure_1_6.UNREADS_ALL_MESSAGES;
} else {
UNREADS_ONLY_MENTIONS = closure_1_6.UNREADS_ONLY_MENTIONS;
}
obj = { flags: guildId(closure_1_2[10]).withGuildUnreadFlags(guildFlags, UNREADS_ONLY_MENTIONS) };
const NotificationLabel = guildId(closure_1_2[11]).NotificationLabel;
const result = obj.updateGuildNotificationSettings(guildId.guildId, obj, NotificationLabel.unreads(ONLY_MENTIONS));
}
};
return jsx(NotificationSettingsMessageUnreadActionSheetDefault, {
disabledMentionOnlyWithReason: stringResult,
value: unread,
onChange(ONLY_MENTIONS) {
const guildFlags = closure_1_3.getGuildFlags(guildId.guildId);
let obj = closure_1_1(closure_1_2[9]);
if (ONLY_MENTIONS === closure_1_5.ALL_MESSAGES) {
let UNREADS_ONLY_MENTIONS = closure_1_6.UNREADS_ALL_MESSAGES;
} else {
UNREADS_ONLY_MENTIONS = closure_1_6.UNREADS_ONLY_MENTIONS;
}
obj = { flags: guildId(closure_1_2[10]).withGuildUnreadFlags(guildFlags, UNREADS_ONLY_MENTIONS) };
const NotificationLabel = guildId(closure_1_2[11]).NotificationLabel;
const result = obj.updateGuildNotificationSettings(guildId.guildId, obj, NotificationLabel.unreads(ONLY_MENTIONS));
}
});
};