654 lines
39 KiB
TypeScript
654 lines
39 KiB
TypeScript
/* Metro module 16128; source: modules/notification_settings/native/NotificationSettingsModal.native.tsx; dependencies: [29, 6, 7, 15, 17, 18, 31, 27, 1383, 1379, 5098, 4111, 1867, 15846, 3793, 4864, 1878, 661, 33, 4501, 697, 4080, 10936, 1962, 6613, 6610, 4863, 10944, 10948, 10955, 7988, 1244, 7987, 6231, 6808, 4573, 1305, 3853, 1948, 10943, 6238, 10938, 6242, 10375, 3787, 4867, 6647, 4805, 7972, 4572, 10939, 3868, 1484, 566, 5099, 5462, 5282, 16129, 10935, 5280, 2] */
|
|
function _fun124496(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#124496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:6, offset: 0x025ba5a9, size: 788 bytes, params: 8, frame: 23
|
|
var object2;
|
|
const env0_0 = require;
|
|
const env0_3 = ['categories'];
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_4 = importDefault(29) /* metro dependency 29 */;
|
|
const env0_5 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_6 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_7 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_8 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_9 = importDefault(18) /* metro dependency 18 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const env0_11 = (require(27) /* metro dependency 27 */).View;
|
|
const env0_12 = (require(1383) /* metro dependency 1383: ChannelRecord */).isGuildReadableType;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildCategoryStore = importDefault(5098) /* metro dependency 5098: GuildCategoryStore */;
|
|
const guildMemberCountStore = importDefault(4111) /* metro dependency 4111: GuildMemberCountStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const notificationSettingsModalStore = importDefault(15846) /* metro dependency 15846: NotificationSettingsModalStore */;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
const userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_21 = constantsModule.AnalyticEvents;
|
|
const env0_22 = constantsModule.UserNotificationSettings;
|
|
const env0_23 = constantsModule.ChannelTypes;
|
|
const env0_24 = constantsModule.NotificationSettingsSections;
|
|
const env0_25 = constantsModule.SettingsPaneTypes;
|
|
const env0_26 = constantsModule.MAX_MEMBERS_NOTIFY_ALL_MESSAGES;
|
|
const env0_27 = constantsModule.GuildFeatures;
|
|
const env0_28 = constantsModule.HighlightSettings;
|
|
const env0_29 = constantsModule.HelpdeskArticles;
|
|
const env0_30 = constantsModule.EMPTY_STRING_SNOWFLAKE_ID;
|
|
const value3 = require(33) /* metro dependency 33 */;
|
|
const env0_31 = value3.jsx;
|
|
const env0_32 = value3.jsxs;
|
|
const env0_33 = value3.Fragment;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createLegacyClassComponentStyles = createStylesModule.createLegacyClassComponentStyles;
|
|
object2 = {};
|
|
const BLUE_345 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BLUE_345;
|
|
object2.highlightsLearnMore = {'fontSize': 12, 'color': null, 'marginTop': 4, color: BLUE_345};
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object2.separator = {'height': 1, 'backgroundColor': null, 'marginVertical': 24, backgroundColor: BORDER_SUBTLE};
|
|
const TABLE_ROW_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.TABLE_ROW_PADDING;
|
|
object2.formStack = {paddingHorizontal: TABLE_ROW_PADDING};
|
|
const env0_34 = Reflect.apply(createLegacyClassComponentStyles, createStylesModule, [object2]);
|
|
const PureComponent = value.PureComponent;
|
|
value = _fun124500(PureComponent);
|
|
const ThemeContext = (require(3868) /* metro dependency 3868: native */).ThemeContext;
|
|
value.contextType = ThemeContext;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/notification_settings/native/NotificationSettingsModal.native.tsx');
|
|
exports.default = NotificationSettingsModal;
|
|
exports.NotificationSettings = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_124497() { // fn#124497, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:622, offset: 0x025ba8bd, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_124497_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun124500(a0) { // fn#124500, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:1112, offset: 0x025ba91f, size: 257 bytes, params: 2, frame: 16
|
|
const closure = NotificationSettings;
|
|
env0_9(closure, a0);
|
|
return env0_6(closure, [{key: 'componentDidMount', value: function() {
|
|
var defaultImport = importDefault(dependencyMap[26]);
|
|
var SETTINGS_PANE_VIEWED = AnalyticEvents.SETTINGS_PANE_VIEWED;
|
|
defaultImport.trackWithMetadata(SETTINGS_PANE_VIEWED, {settings_type: 'guild',
|
|
destination_pane: SettingsPaneTypes.GUILD_NOTIFICATION_SETTINGS});
|
|
}}, {key: 'renderServerSettings', value: value_124508}, {key: 'renderNotificationOptions', value: value_124509},
|
|
{key: 'renderMuteSection', value: value_124516}, {key: 'renderChannels', value: value_124517},
|
|
{key: 'renderChannel', value: value_124519}, {key: 'render', value: value_124521},
|
|
{key: 'getOverriddenChannels', value: value_124522}]);
|
|
}
|
|
|
|
function ConnectedNotificationSettings({guildId}) { // fn#124525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:8220, offset: 0x025bbf57, size: 304 bytes, params: 2, frame: 23
|
|
const value2 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([UserGuildSettingsStore,
|
|
GuildStore, GuildCategoryStore, GuildMemberCountStore], _fun124526);
|
|
const categories = value3.categories;
|
|
const value4 = env0_4(value3, env0_3);
|
|
const value5 = env0_10.useMemo(_fun124527, [categories]);
|
|
const value6 = (require(10939) /* metro dependency 10939: NotificationUtils */).useShouldUseNewNotificationSystem('NotificationSettingsModalNative');
|
|
const jsxRuntimeEnv0_33Binding = jsxRuntimeEnv0_33;
|
|
const env0_352 = ((Component) => <Component guildId={guildId} channels={value5} navigation={value2} shouldUseNewNotificationSystem={value6} {...value4} />)(env0_35);
|
|
const NavScrim = (require(5462) /* metro dependency 5462: NavScrimAndroid */).NavScrim;
|
|
return (
|
|
<>
|
|
{env0_352}
|
|
<NavScrim />
|
|
</>
|
|
);
|
|
}
|
|
|
|
function NotificationSettingsModal() { // fn#124529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:9217, offset: 0x025bc1ca, size: 170 bytes, params: 1, frame: 18
|
|
const guildId = (require(566) /* metro dependency 566: flux */).useStateFromStores([NotificationSettingsModalStore],
|
|
function() {
|
|
return NotificationSettingsModalStore.getProps().guildId;
|
|
});
|
|
const value2 = env0_10.useMemo(function() {
|
|
return _fun124532();
|
|
}, []);
|
|
const Navigator = (require(5280) /* metro dependency 5280: NavigatorNative */).Navigator;
|
|
const OVERVIEW = NotificationSettingsSections.OVERVIEW;
|
|
return (
|
|
<Navigator
|
|
screens={value2}
|
|
initialRouteStack={[{name: OVERVIEW, params: {guildId: guildId ?? EMPTY_STRING_SNOWFLAKE_ID}}]}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function NotificationSettings(a0) { // fn#124501, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:1124, offset: 0x025baa20, size: 197 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_5;
|
|
binding(this, NotificationSettings);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_8(NotificationSettings);
|
|
binding = env1_7;
|
|
if (_isNativeReflectConstruct_124497()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_8(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.handleMutePress = handleMutePress;
|
|
value.handleToggleChange = handleToggleChange;
|
|
value.handleTypeChange = handleTypeChange;
|
|
value.handleAddOverride = handleAddOverride;
|
|
value.handleChannelSelect = handleChannelSelect_124506;
|
|
return value;
|
|
}
|
|
|
|
function value_124508() { // fn#124508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:2292, offset: 0x025bad1c, size: 796 bytes, params: 1, frame: 29
|
|
var r0;
|
|
var TableRadioGroup;
|
|
var object;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const TableRadioRow = (require(7987) /* metro dependency 7987: TableRadioRowNative */).TableRadioRow;
|
|
var object2;
|
|
var value3;
|
|
var items3;
|
|
var jsxRuntimeEnv1_33Binding;
|
|
var NotificationSettingsGuildPresets;
|
|
var guildId;
|
|
var items2;
|
|
var NotificationSettingsGuildMessageNotification;
|
|
var NotificationSettingsGuildMessageUnread;
|
|
let props = this.props;
|
|
const messageNotifications = props.messageNotifications;
|
|
const muted = props.muted;
|
|
const guildMemberCount = props.guildMemberCount;
|
|
const shouldUseNewNotificationSystem = props.shouldUseNewNotificationSystem;
|
|
let value = environment.__proto__;
|
|
if (shouldUseNewNotificationSystem) {
|
|
jsxRuntimeEnv1_33Binding = jsxRuntimeEnv1_33;
|
|
NotificationSettingsGuildPresets = (require(10944) /* metro dependency 10944: NotificationSettingsPresets */).NotificationSettingsGuildPresets;
|
|
props = this.props;
|
|
guildId = props.guildId;
|
|
value = <NotificationSettingsGuildPresets guildId={guildId} />;
|
|
items2 = [value];
|
|
NotificationSettingsGuildMessageNotification = (require(10948) /* metro dependency 10948: NotificationSettingsMessageNotification */).NotificationSettingsGuildMessageNotification;
|
|
props = this.props;
|
|
guildId = props.guildId;
|
|
items2[1] = <NotificationSettingsGuildMessageNotification style={{marginTop: 24}} guildId={guildId} />;
|
|
NotificationSettingsGuildMessageUnread = (require(10955) /* metro dependency 10955: NotificationSettingsMessageUnread */).NotificationSettingsGuildMessageUnread;
|
|
props = this.props;
|
|
guildId = props.guildId;
|
|
items2[2] = <NotificationSettingsGuildMessageUnread style={{marginTop: 24}} guildId={guildId} />;
|
|
value = <View>{items2}</View>;
|
|
value = <>{value}<View style={env1_34(this.context).separator} /></>;
|
|
r0 = value;
|
|
} else {
|
|
TableRadioGroup = (require(7988) /* metro dependency 7988: TableRadioGroupNative */).TableRadioGroup;
|
|
var tableRadioGroupProps = {title: intl.string(t.lprV7V), value: messageNotifications,
|
|
onChange: this.handleTypeChange, hasIcons: false};
|
|
var tableRadioRowProps = {label: intl.string(t['n/bTaY']), disabled: muted,
|
|
value: UserNotificationSettings.ALL_MESSAGES};
|
|
value3 = null;
|
|
tableRadioRowProps.subLabel = value3 != guildMemberCount && guildMemberCount >= MAX_MEMBERS_NOTIFY_ALL_MESSAGES ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Dh5p5j) : value3;
|
|
items3 = [<TableRadioRow {...tableRadioRowProps} />];
|
|
items3[1] = <TableRadioRow label={intl.format(t.L2hmYy,
|
|
{})} value={UserNotificationSettings.ONLY_MENTIONS} disabled={muted} />;
|
|
items3[2] = <TableRadioRow label={intl.string(t.CtVGyQ)} value={UserNotificationSettings.NO_MESSAGES} disabled={muted} />;
|
|
r0 = <TableRadioGroup {...tableRadioGroupProps}>{items3}</TableRadioGroup>;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_124509() { // fn#124509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:3352, offset: 0x025bb038, size: 1036 bytes, params: 1, frame: 38
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
const value2 = env1_34(this.context);
|
|
const props = this.props;
|
|
const muted = props.muted;
|
|
const suppressEveryone = props.suppressEveryone;
|
|
const suppressRoles = props.suppressRoles;
|
|
const mobilePush = props.mobilePush;
|
|
const muteEvents = props.muteEvents;
|
|
const notifyHighlights = props.notifyHighlights;
|
|
const env0_1 = props.guildId;
|
|
const jsxRuntimeEnv1_33Binding = jsxRuntimeEnv1_33;
|
|
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
|
|
const TableSwitchRow = (require(6808) /* metro dependency 6808: TableSwitchRowNative */).TableSwitchRow;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const format = intl.format;
|
|
const OWiWAp = (require(1244) /* metro dependency 1244: indexNative */).t.OWiWAp;
|
|
const items3 = [<TableSwitchRow label={Reflect.apply(format, intl, [OWiWAp,
|
|
{}])} value={suppressEveryone != null && suppressEveryone} onValueChange={onValueChange_124510} />];
|
|
let string = intl.string;
|
|
items3[1] = <TableSwitchRow label={Reflect.apply(string, intl,
|
|
[(require(1244) /* metro dependency 1244: indexNative */).t['O/QdoD']])} value={suppressRoles != null && suppressRoles} onValueChange={onValueChange_124511} />;
|
|
items3[2] = <TableSwitchRow disabled={muted} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.gPuteJ)} value={muted || notifyHighlights === HighlightSettings.DISABLED} onValueChange={function(a0) {
|
|
var defaultImport = importDefault(dependencyMap[24]);
|
|
var updateGuildNotificationSettings = defaultImport.updateGuildNotificationSettings;
|
|
var guildIdBinding = guildId;
|
|
var object = {};
|
|
object.notify_highlights = a0 ? HighlightSettings.DISABLED : HighlightSettings.ENABLED;
|
|
var NotificationLabel = require(dependencyMap[25]).NotificationLabel;
|
|
Reflect.apply(updateGuildNotificationSettings, defaultImport, [guildIdBinding, object,
|
|
NotificationLabel.highlights(!a0)]);
|
|
}} />;
|
|
const items2 = [<TableRowGroup hasIcons={false}>{items3}</TableRowGroup>];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
items2[1] = <Text variant="text-sm/medium" color="text-muted" style={{marginTop: 8}}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Vw/Xn8'])}</Text>;
|
|
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
const highlightsLearnMore = value2.highlightsLearnMore;
|
|
string = intl.string;
|
|
const PRBn9K = (require(1244) /* metro dependency 1244: indexNative */).t.PRBn9K;
|
|
items2[2] = <LegacyText style={highlightsLearnMore} accessibilityRole="link" onPress={function() {
|
|
return importDefault(dependencyMap[37]).openURL(importDefault(dependencyMap[38]).getArticleURL(HelpdeskArticles.HIGHLIGHTS));
|
|
}}>{Reflect.apply(string, intl, [PRBn9K])}</LegacyText>;
|
|
const view = <View>{items2}</View>;
|
|
string = intl.string;
|
|
const ONG3Yz = (require(1244) /* metro dependency 1244: indexNative */).t.ONG3Yz;
|
|
return (
|
|
<>
|
|
{view}
|
|
<TableRowGroup hasIcons={false}>
|
|
<TableSwitchRow
|
|
label={Reflect.apply(string, intl, [ONG3Yz])}
|
|
value={muteEvents != null && muteEvents}
|
|
onValueChange={onValueChange_124514}
|
|
/>
|
|
<TableSwitchRow
|
|
disabled={muted}
|
|
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.h1DL66)}
|
|
value={!muted && mobilePush != null && mobilePush}
|
|
onValueChange={onValueChange_124515}
|
|
/>
|
|
</TableRowGroup>
|
|
</>
|
|
);
|
|
}
|
|
|
|
function value_124516() { // fn#124516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:5097, offset: 0x025bb61d, size: 563 bytes, params: 1, frame: 24
|
|
var r0;
|
|
var value;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var NotificationSettingsMuteBanner;
|
|
const props = this.props;
|
|
const muted = props.muted;
|
|
const muteConfig = props.muteConfig;
|
|
const guild = props.guild;
|
|
if (props.shouldUseNewNotificationSystem) {
|
|
value = null;
|
|
if (muted) {
|
|
value = environment.__proto__;
|
|
NotificationSettingsMuteBanner = (require(10943) /* metro dependency 10943: NotificationSettingsMuteBanner */).NotificationSettingsMuteBanner;
|
|
var notificationSettingsMuteBannerProps = {title: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ZSkXJY)};
|
|
value = require(10943) /* metro dependency 10943: NotificationSettingsMuteBanner */;
|
|
notificationSettingsMuteBannerProps.subtitle = value.getMuteBannerSubtitleFromConfig(muteConfig);
|
|
notificationSettingsMuteBannerProps.style = {marginBottom: 16};
|
|
notificationSettingsMuteBannerProps.onPressUnmute = this.handleMutePress;
|
|
value = <NotificationSettingsMuteBanner {...notificationSettingsMuteBannerProps} />;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
value = environment.__proto__;
|
|
const value2 = undefined;
|
|
const format = intl.format;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const r7 = muted ? Reflect.apply(format, intl, [t.e8hzDQ,
|
|
{name: guild == null ? value2 : guild.name}]) : Reflect.apply(format, intl, [t['J+7D9E'],
|
|
{name: guild == null ? value2 : guild.name}]);
|
|
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
|
|
let object = {};
|
|
object.helperText = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8wbTQ6']);
|
|
object.hasIcons = false;
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
object = [<TableRowGroup {...object} key="mute"><TableRow label={r7} onPress={this.handleMutePress} arrow={!muted} /></TableRowGroup>];
|
|
object[1] = muted ? ((Component) => <Component muteConfig={muteConfig} type={(require(10938) /* metro dependency 10938: MutedUntilText */).MuteSettingType.SERVER} key="muted-until" />)(importDefault(10938) /* metro dependency 10938: MutedUntilText */) : null;
|
|
return object;
|
|
}
|
|
|
|
function value_124517() { // fn#124517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:5864, offset: 0x025bb850, size: 343 bytes, params: 1, frame: 26
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const O4TIvi = (require(1244) /* metro dependency 1244: indexNative */).t.O4TIvi;
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const TableRowIcon = (require(6242) /* metro dependency 6242: TableRowIconNative */).TableRowIcon;
|
|
const PlusMediumIcon = (require(10375) /* metro dependency 10375: PlusMediumIcon */).PlusMediumIcon;
|
|
items = [<TableRowGroup title={Reflect.apply(string, intl,
|
|
[O4TIvi])} hasIcons key="override-header"><TableRow icon={<TableRowIcon IconComponent={PlusMediumIcon} />} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.quib7R)} onPress={this.handleAddOverride} /></TableRowGroup>];
|
|
items[1] = <TableRowGroup hasIcons key="override-channels">{this.getOverriddenChannels().map(_fun124518)}</TableRowGroup>;
|
|
return items;
|
|
}
|
|
|
|
function value_124519(a0) { // fn#124519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:6325, offset: 0x025bb9c0, size: 776 bytes, params: 2, frame: 27
|
|
var environment;
|
|
var r14;
|
|
var r9;
|
|
var r7;
|
|
var props;
|
|
var channelOverrides;
|
|
var id;
|
|
var property;
|
|
var parent_id;
|
|
var value2;
|
|
var value5;
|
|
var moduleValue;
|
|
var message_notifications;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var moduleValue2;
|
|
var presetName;
|
|
var moduleValue3;
|
|
var TableRow;
|
|
var moduleValue5;
|
|
var moduleValue6;
|
|
const env0_1 = a0;
|
|
const value = null;
|
|
if (value != a0) {
|
|
props = this.props;
|
|
channelOverrides = props.channelOverrides;
|
|
id = a0.id;
|
|
property = channelOverrides[id];
|
|
parent_id = a0.parent_id;
|
|
value2 = undefined;
|
|
r14 = value != parent_id ? ChannelStore.getChannel(a0.parent_id) : value2;
|
|
value5 = environment.__proto__;
|
|
moduleValue = require(3787) /* metro dependency 3787: MuteTimers */;
|
|
if (moduleValue.computeIsMuted(property)) {
|
|
r9 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.fpKdS1);
|
|
} else {
|
|
message_notifications = property.message_notifications;
|
|
if (UserNotificationSettings.ALL_MESSAGES === message_notifications) {
|
|
r9 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['n/bTaY']);
|
|
} else if (UserNotificationSettings.ONLY_MENTIONS === message_notifications) {
|
|
r9 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['6fQPhu']);
|
|
} else if (UserNotificationSettings.NO_MESSAGES !== message_notifications) {
|
|
r9 = value2;
|
|
} else {
|
|
r9 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.CtVGyQ);
|
|
}
|
|
}
|
|
props = this.props;
|
|
if (props.shouldUseNewNotificationSystem) {
|
|
moduleValue2 = require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */;
|
|
presetName = moduleValue2.presetName;
|
|
moduleValue3 = require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */;
|
|
r9 = Reflect.apply(presetName, moduleValue2,
|
|
[moduleValue3.presetFromSettings(UserGuildSettingsStore.resolveUnreadSetting(a0),
|
|
UserGuildSettingsStore.resolvedMessageNotifications(a0))]);
|
|
}
|
|
TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
var tableRowProps = {icon: ((TableRowIcon) => <TableRowIcon IconComponent={(require(6647) /* metro dependency 6647: ChannelUtils */).getChannelIconComponent(a0)} />)((require(6242) /* metro dependency 6242: TableRowIconNative */).TableRowIcon)};
|
|
moduleValue5 = require(4805) /* metro dependency 4805: useChannelName */;
|
|
tableRowProps.label = moduleValue5.computeChannelName(a0, UserStore, RelationshipStore);
|
|
tableRowProps.onPress = onPress_124520;
|
|
if (value != r14) {
|
|
moduleValue6 = require(4805) /* metro dependency 4805: useChannelName */;
|
|
r7 = moduleValue6.computeChannelName(r14, UserStore, RelationshipStore);
|
|
} else {
|
|
r7 = value;
|
|
}
|
|
tableRowProps.subLabel = r7;
|
|
tableRowProps.trailing = value != r9 ? ((TrailingText) => <TrailingText text={r9} />)((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.TrailingText) : value2;
|
|
tableRowProps.arrow = true;
|
|
id = a0.id;
|
|
return <TableRow {...tableRowProps} key={id} />;
|
|
}
|
|
}
|
|
|
|
function value_124521() { // fn#124521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:7269, offset: 0x025bbce5, size: 415 bytes, params: 1, frame: 22
|
|
var r0;
|
|
var features;
|
|
const Form = (require(7972) /* metro dependency 7972: native */).Form;
|
|
const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
|
|
const guild = this.props.guild;
|
|
let value = environment.__proto__;
|
|
const value2 = env1_34(this.context);
|
|
if (guild == null) {
|
|
var stackProps = {spacing: (importDefault(697) /* metro dependency 697: native */).space.PX_24,
|
|
style: value2.formStack};
|
|
value = this.renderMuteSection();
|
|
value = <Form contentContainerStyle={{paddingTop: 16}}><Stack {...stackProps}>{[value,
|
|
this.renderServerSettings(),
|
|
this.renderNotificationOptions(), this.renderChannels()]}</Stack></Form>;
|
|
r0 = value;
|
|
} else {
|
|
features = guild.features;
|
|
if (features.has(GuildFeatures.HUB)) {
|
|
r0 = <Form contentContainerStyle={{paddingTop: 16}}><Stack spacing={(importDefault(697) /* metro dependency 697: native */).space.PX_24} style={value2.formStack}>{this.renderMuteSection()}</Stack></Form>;
|
|
} else {
|
|
var stackProps = {spacing: (importDefault(697) /* metro dependency 697: native */).space.PX_24,
|
|
style: value2.formStack};
|
|
value = this.renderMuteSection();
|
|
value = <Form contentContainerStyle={{paddingTop: 16}}><Stack {...stackProps}>{[value,
|
|
this.renderServerSettings(),
|
|
this.renderNotificationOptions(), this.renderChannels()]}</Stack></Form>;
|
|
r0 = value;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_124522() { // fn#124522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:7815, offset: 0x025bbe84, size: 171 bytes, params: 1, frame: 18
|
|
var environment;
|
|
const {channels, channelOverrides} = this.props;
|
|
const Set = global.Set;
|
|
let value = environment.__proto__;
|
|
value = Reflect.apply((require(10939) /* metro dependency 10939: NotificationUtils */).filterOverrides, value,
|
|
[channelOverrides, {ignoreNotificationSetting: false, ignoreMute: this.props.shouldUseNewNotificationSystem,
|
|
ignoreUnreadSetting: !this.props.shouldUseNewNotificationSystem}]);
|
|
const set = new Set(value);
|
|
return channels.map(_fun124523).filter(function(a0) {
|
|
return a0;
|
|
});
|
|
}
|
|
|
|
function _fun124526() { // fn#124526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:8314, offset: 0x025bc087, size: 221 bytes, params: 1, frame: 14
|
|
const object2 = {};
|
|
const getGuild = GuildStore.getGuild;
|
|
const guildIdBinding = guildId;
|
|
object2.guild = Reflect.apply(getGuild, GuildStore, [guildIdBinding]);
|
|
object2.suppressEveryone = UserGuildSettingsStore.isSuppressEveryoneEnabled(guildIdBinding);
|
|
object2.suppressRoles = UserGuildSettingsStore.isSuppressRolesEnabled(guildIdBinding);
|
|
object2.mobilePush = UserGuildSettingsStore.isMobilePushEnabled(guildIdBinding);
|
|
object2.muteEvents = UserGuildSettingsStore.isMuteScheduledEventsEnabled(guildIdBinding);
|
|
object2.muted = UserGuildSettingsStore.isMuted(guildIdBinding);
|
|
object2.muteConfig = UserGuildSettingsStore.getMuteConfig(guildIdBinding);
|
|
object2.messageNotifications = UserGuildSettingsStore.getMessageNotifications(guildIdBinding);
|
|
object2.channelOverrides = UserGuildSettingsStore.getChannelOverrides(guildIdBinding);
|
|
object2.categories = GuildCategoryStore.getCategories(guildIdBinding);
|
|
object2.guildMemberCount = GuildMemberCountStore.getMemberCount(guildIdBinding);
|
|
object2.notifyHighlights = UserGuildSettingsStore.getNotifyHighlights(guildIdBinding);
|
|
return object2;
|
|
}
|
|
|
|
function _fun124527() { // fn#124527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:8802, offset: 0x025bc164, size: 56 bytes, params: 1, frame: 15
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
value = importDefault(5099) /* metro dependency 5099: getFlattedChannelList */;
|
|
const categoriesBinding = categories;
|
|
return value(categoriesBinding._categories, categoriesBinding, _fun124528);
|
|
}
|
|
|
|
function _fun124531() { // fn#124531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:9333, offset: 0x025bc28c, size: 17 bytes, params: 1, frame: 9
|
|
return getScreens_124532();
|
|
}
|
|
|
|
function handleMutePress() { // fn#124502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:1388, owner: NotificationSettings.handleMutePress, offset: 0x025baae5, size: 207 bytes, params: 1, frame: 21
|
|
var defaultImport;
|
|
var openLazy;
|
|
var object2;
|
|
var defaultImport2;
|
|
var updateGuildNotificationSettings;
|
|
var value3;
|
|
var NotificationLabel;
|
|
let {guildId, muted} = env0_0.props;
|
|
let value = environment.__proto__.__proto__;
|
|
if (muted) {
|
|
defaultImport2 = importDefault(dependencyMap[24]);
|
|
updateGuildNotificationSettings = defaultImport2.updateGuildNotificationSettings;
|
|
object2 = {};
|
|
value3 = !muted;
|
|
object2.muted = value3;
|
|
NotificationLabel = require(dependencyMap[25]).NotificationLabel;
|
|
muted = NotificationLabel.muted;
|
|
Reflect.apply(updateGuildNotificationSettings, defaultImport2, [guildId, object2, Reflect.apply(muted,
|
|
NotificationLabel, [value3])]);
|
|
} else {
|
|
defaultImport = importDefault(dependencyMap[21]);
|
|
openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[23]);
|
|
value = value(dependencyMap[22], dependencyMap.paths);
|
|
Reflect.apply(openLazy, defaultImport, [value, 'muteSettings' + guildId, {guildId: guildId}]);
|
|
}
|
|
}
|
|
|
|
function handleToggleChange(a0, a1, a2) { // fn#124503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:1619, owner: NotificationSettings.handleToggleChange, offset: 0x025babb4, size: 73 bytes, params: 4, frame: 17
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(6613) /* metro dependency 6613: NotificationSettingsModalActionCreators */;
|
|
value.updateGuildNotificationSettings(env0_0.props.guildId, {[a0]: a1}, a2);
|
|
}
|
|
|
|
function NotificationSettingsHandleTypeChange(a0) { // fn#124504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:1717, owner: NotificationSettings.handleTypeChange, offset: 0x025babfd, size: 100 bytes, params: 2, frame: 19
|
|
const defaultImport = importDefault(6613) /* metro dependency 6613: NotificationSettingsModalActionCreators */;
|
|
const updateGuildNotificationSettings = defaultImport.updateGuildNotificationSettings;
|
|
const guildId = env0_0.props.guildId;
|
|
const NotificationLabel = (require(6610) /* metro dependency 6610: NotificationSettingsUtils */).NotificationLabel;
|
|
Reflect.apply(updateGuildNotificationSettings, defaultImport, [guildId, {message_notifications: a0},
|
|
NotificationLabel.notifications(a0)]);
|
|
}
|
|
|
|
function handleAddOverride() { // fn#124505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:1870, owner: NotificationSettings.handleAddOverride, offset: 0x025bac61, size: 57 bytes, params: 1, frame: 14
|
|
const {guildId, navigation} = env0_0.props;
|
|
const push = navigation.push;
|
|
const ADD_OVERRIDE = NotificationSettingsSections.ADD_OVERRIDE;
|
|
Reflect.apply(push, navigation, [ADD_OVERRIDE, {guildId: guildId}]);
|
|
}
|
|
|
|
function NotificationSettingsHandleChannelSelect(a0) { // fn#124506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:1970, owner: NotificationSettings.handleChannelSelect, offset: 0x025bac9a, size: 55 bytes, params: 2, frame: 14
|
|
const navigation = env0_0.props.navigation;
|
|
const push = navigation.push;
|
|
const CHANNEL_OVERRIDE = NotificationSettingsSections.CHANNEL_OVERRIDE;
|
|
Reflect.apply(push, navigation, [CHANNEL_OVERRIDE, {channelId: a0}]);
|
|
}
|
|
|
|
function value_124509OnValueChange(a0) { // fn#124510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:3702, owner: value_124509.onValueChange, offset: 0x025bb444, size: 71 bytes, params: 2, frame: 16
|
|
const binding = env0_0;
|
|
const handleToggleChange = binding.handleToggleChange;
|
|
const value = environment.__proto__.__proto__;
|
|
const NotificationLabel = (require(6610) /* metro dependency 6610: NotificationSettingsUtils */).NotificationLabel;
|
|
Reflect.apply(handleToggleChange, binding, ['suppress_everyone', a0, NotificationLabel.suppressEveryone(a0)]);
|
|
}
|
|
|
|
function value_124509OnValueChange_124511(a0) { // fn#124511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:3910, owner: value_124509.onValueChange, offset: 0x025bb48b, size: 71 bytes, params: 2, frame: 16
|
|
const binding = env0_0;
|
|
const handleToggleChange = binding.handleToggleChange;
|
|
const value = environment.__proto__.__proto__;
|
|
const NotificationLabel = (require(6610) /* metro dependency 6610: NotificationSettingsUtils */).NotificationLabel;
|
|
Reflect.apply(handleToggleChange, binding, ['suppress_roles', a0, NotificationLabel.suppressRoles(a0)]);
|
|
}
|
|
|
|
function value_124509OnValueChange_124514(a0) { // fn#124514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:4750, owner: value_124509.onValueChange, offset: 0x025bb58f, size: 71 bytes, params: 2, frame: 16
|
|
const binding = env0_0;
|
|
const handleToggleChange = binding.handleToggleChange;
|
|
const value = environment.__proto__.__proto__;
|
|
const NotificationLabel = (require(6610) /* metro dependency 6610: NotificationSettingsUtils */).NotificationLabel;
|
|
Reflect.apply(handleToggleChange, binding, ['mute_scheduled_events', a0, NotificationLabel.mutedEvents(a0)]);
|
|
}
|
|
|
|
function value_124509OnValueChange_124515(a0) { // fn#124515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:4969, owner: value_124509.onValueChange, offset: 0x025bb5d6, size: 71 bytes, params: 2, frame: 16
|
|
const binding = env0_0;
|
|
const handleToggleChange = binding.handleToggleChange;
|
|
const value = environment.__proto__.__proto__;
|
|
const NotificationLabel = (require(6610) /* metro dependency 6610: NotificationSettingsUtils */).NotificationLabel;
|
|
Reflect.apply(handleToggleChange, binding, ['mobile_push', a0, NotificationLabel.mobilePush(a0)]);
|
|
}
|
|
|
|
function _fun124518(a0) { // fn#124518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:6246, offset: 0x025bb9a7, size: 25 bytes, params: 2, frame: 11
|
|
return env0_0.renderChannel(a0);
|
|
}
|
|
|
|
function value_124519OnPress() { // fn#124520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:7071, owner: value_124519.onPress, offset: 0x025bbcc8, size: 29 bytes, params: 1, frame: 11
|
|
const binding = env0_0;
|
|
return binding.handleChannelSelect(env0_1.id);
|
|
}
|
|
|
|
function _fun124523({channel}) { // fn#124523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:8077, offset: 0x025bbf2f, size: 40 bytes, params: 2, frame: 12
|
|
const binding = env0_0;
|
|
return binding.has(channel.id) ? channel : null;
|
|
}
|
|
|
|
function _fun124528({channel}) { // fn#124528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:8832, offset: 0x025bc19c, size: 46 bytes, params: 2, frame: 12
|
|
const type = channel.type;
|
|
const value = environment.__proto__.__proto__;
|
|
return isGuildReadableType(type) || type === ChannelTypes.GUILD_CATEGORY;
|
|
}
|
|
|
|
function getScreens_124532() { // fn#124532, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:9337, offset: 0x025bc29d, size: 345 bytes, params: 1, frame: 21
|
|
var environment;
|
|
const object5 = {};
|
|
const value = environment.__proto__.__proto__;
|
|
const OVERVIEW = NotificationSettingsSections.OVERVIEW;
|
|
const object6 = {};
|
|
object6.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton((importDefault(6613) /* metro dependency 6613: NotificationSettingsModalActionCreators */).close);
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
object6.title = Reflect.apply(string, intl, [t.h850Ss]);
|
|
object6.render = render_124533;
|
|
object5[OVERVIEW] = object6;
|
|
const ADD_OVERRIDE = NotificationSettingsSections.ADD_OVERRIDE;
|
|
const object7 = {};
|
|
object7.title = intl.string(t.s7vIQT);
|
|
object7.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderBackButton();
|
|
object7.render = render_124534;
|
|
object5[ADD_OVERRIDE] = object7;
|
|
const CHANNEL_OVERRIDE = NotificationSettingsSections.CHANNEL_OVERRIDE;
|
|
const object8 = {};
|
|
object8.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderBackButton();
|
|
object8.title = intl.string(t.h850Ss);
|
|
object8.render = render_124535;
|
|
object5[CHANNEL_OVERRIDE] = object8;
|
|
return object5;
|
|
}
|
|
|
|
function getScreens_124532Render({guildId}) { // fn#124533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:9490, owner: getScreens_124532.render, offset: 0x025bc3f6, size: 35 bytes, params: 2, frame: 13
|
|
return <ConnectedNotificationSettings guildId={guildId} />;
|
|
}
|
|
|
|
function getScreens_124532Render_124534({guildId}, a1) { // fn#124534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:9664, owner: getScreens_124532.render, offset: 0x025bc419, size: 59 bytes, params: 3, frame: 14
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
return ((Component) => <Component guildId={guildId} navigation={a1} />)(importDefault(16129) /* metro dependency 16129: NotificationSettingChannelOverridesNative */);
|
|
}
|
|
|
|
function getScreens_124532Render_124535({channelId}) { // fn#124535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16336:9836, owner: getScreens_124532.render, offset: 0x025bc454, size: 58 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
return ((Component) => <Component channelId={channelId} inGuildContext />)(importDefault(10935) /* metro dependency 10935: ChannelSettingsNotifications */);
|
|
}
|
|
|