This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,37 @@
// Metro module 10318 (f10319).
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
import { UserNotificationSettings } from "../../../../Constants";
import { GuildNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
import { Presets, presetFromSettings } from "./notificationSettingsPresetUtils";
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
import { withGuildUnreadFlags } from "./notificationSettingsFlagUtils";
import { NotificationLabels } from "../../../../utils/NotificationSettingsUtils";
import { useStateFromStores } from "../../../../_bundle/defaultAreStatesEqual";
export function updateGuildPreset(a0, a1) {
const guildFlags = UserGuildSettingsStore.getGuildFlags(a0);
if (a1 === Presets.ALL_MESSAGES) {
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(a0, {
message_notifications: UserNotificationSettings.ALL_MESSAGES,
flags: withGuildUnreadFlags(guildFlags, GuildNotificationSettingsFlags.UNREADS_ALL_MESSAGES)
}, NotificationLabels.PresetAll);
} else if (a1 === Presets.MENTIONS) {
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(a0, {
message_notifications: UserNotificationSettings.ONLY_MENTIONS,
flags: withGuildUnreadFlags(guildFlags, GuildNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
}, NotificationLabels.PresetMentions);
} else if (a1 === Presets.NOTHING) {
NotificationSettingsModalActionCreators.updateGuildNotificationSettings(a0, {
message_notifications: UserNotificationSettings.NO_MESSAGES,
flags: withGuildUnreadFlags(guildFlags, GuildNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
}, NotificationLabels.PresetNothing);
}
}
export function useGuildPresetSettings(c17866_0) {
const stateFromStores = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.getGuildUnreadSetting(c17866_0));
const stateFromStores2 = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.getMessageNotifications(c17866_0));
return {
unread: stateFromStores,
notification: stateFromStores2,
preset: presetFromSettings(stateFromStores, stateFromStores2)
};
}