21 lines
1.7 KiB
TypeScript
21 lines
1.7 KiB
TypeScript
// Metro module 10331 (f10332).
|
|
import UserGuildSettingsStore from "../../../../stores/UserGuildSettingsStore";
|
|
import { UserNotificationSettings } from "../../../../Constants";
|
|
import { UnreadSetting } from "../../../read_states/ReadStateConstants";
|
|
import { ChannelNotificationSettingsFlags } from "../../../user_settings/UserSettingsConstants";
|
|
import { useChannelPresetSettings } from "../utils/notficationSettingsChannelFlagUtils";
|
|
import NotificationSettingsMessageUnreadActionSheet from "./NotificationSettingsMessageUnreadActionSheet";
|
|
import { intl, t } from "../../../../intl/index.native";
|
|
import NotificationSettingsModalActionCreators from "../../../../actions/NotificationSettingsModalActionCreators";
|
|
import { withChannelUnreadFlags } from "../utils/notificationSettingsFlagUtils";
|
|
import { NotificationLabel } from "../../../../utils/NotificationSettingsUtils";
|
|
export default function NotificationSettingsMessageUnreadChannelActionSheet(props) {
|
|
let c17878_0 = props;
|
|
const channelPresetSettings = useChannelPresetSettings(props.channel);
|
|
return <NotificationSettingsMessageUnreadActionSheet value={channelPresetSettings.unread} disabledMentionOnlyWithReason={channelPresetSettings.notification === UserNotificationSettings.ALL_MESSAGES ? intl.string(t.eP8yWU) : void 0} onChange={(event) => {
|
|
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(c17878_0.channel.guild_id, c17878_0.channel.id, {
|
|
flags: withChannelUnreadFlags(UserGuildSettingsStore.getChannelIdFlags(c17878_0.channel.guild_id, c17878_0.channel.id), event === UnreadSetting.ALL_MESSAGES ? ChannelNotificationSettingsFlags.UNREADS_ALL_MESSAGES : ChannelNotificationSettingsFlags.UNREADS_ONLY_MENTIONS)
|
|
}, NotificationLabel.unreads(event));
|
|
}} />;
|
|
};
|