284 lines
16 KiB
TypeScript
284 lines
16 KiB
TypeScript
/* Metro module 10934; source: components_native/InAppNotificationSettingsModal.tsx; dependencies: [6, 7, 15, 17, 18, 31, 1383, 1379, 3793, 4864, 1878, 661, 33, 6613, 6610, 7007, 4805, 7972, 1244, 10935, 566, 5282, 5280, 2] */
|
|
import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import ChannelStore from '../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserStore from '../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import RelationshipStore from '../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import UserGuildSettingsStore from '../stores/UserGuildSettingsStore.tsx'; /* Metro dependency 4864 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as FluxModule from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as ChannelRecordModule from '../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
|
|
import * as UseChannelNameModule from '../modules/channel/useChannelName.tsx'; /* Metro dependency 4805 */
|
|
import * as NavigatorNativeModule from '../design/components/Navigator/native/Navigator.native.tsx'; /* Metro dependency 5280 */
|
|
import * as NavigatorHeaderNativeModule from '../design/components/Navigator/native/NavigatorHeader.native.tsx'; /* Metro dependency 5282 */
|
|
import * as NativeModule from '../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
|
|
|
|
function _fun83807(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:6, offset: 0x01f29707, size: 414 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const PureComponent = value.PureComponent;
|
|
const env0_18 = _fun83816(PureComponent);
|
|
value = value.memo(_fun83824);
|
|
(FileImportTrackerModule).fileFinishedImporting('components_native/InAppNotificationSettingsModal.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_83808() { // fn#83808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:304, offset: 0x01f298a5, 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_83808_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function ConnectedInAppNotificationSettingsScreen({channel}) { // fn#83811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:2345, offset: 0x01f29907, size: 96 bytes, params: 2, frame: 17
|
|
return ((Component) => <Component channel={channel} isMuted={(FluxModule).useStateFromStores([UserGuildSettingsStore],
|
|
_fun83812)} />)(env0_18);
|
|
function _fun83812() { // fn#83812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:2447, offset: 0x01f29967, size: 83 bytes, params: 1, frame: 15
|
|
var r0;
|
|
var value3;
|
|
var userGuildSettingsStoreBinding;
|
|
var isChannelMuted;
|
|
var value;
|
|
let channelBinding = channel;
|
|
const value2 = undefined;
|
|
if (channelBinding != null) {
|
|
value3 = environment.__proto__;
|
|
if (isMultiUserDM(channel.type)) {
|
|
userGuildSettingsStoreBinding = UserGuildSettingsStore;
|
|
isChannelMuted = userGuildSettingsStoreBinding.isChannelMuted;
|
|
channelBinding = channel;
|
|
value = channelBinding.getGuildId();
|
|
value = Reflect.apply(isChannelMuted, userGuildSettingsStoreBinding, [value, channelBinding.id]);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function getScreens_83813(a0, a1) { // fn#83813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:2551, offset: 0x01f299ba, size: 104 bytes, params: 3, frame: 14
|
|
const env0_0 = ChannelStore.getChannel(a0);
|
|
const object2 = {headerTitle: headerTitle_83814};
|
|
object2.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton(a1);
|
|
object2.render = render_83815;
|
|
return {IN_APP_NOTIFICATION_SETTINGS: object2};
|
|
function getScreens_83813HeaderTitle() { // fn#83814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:2647, owner: getScreens_83813.headerTitle, offset: 0x01f29a22, size: 163 bytes, params: 1, frame: 22
|
|
var r4;
|
|
var moduleValue;
|
|
const binding = env0_0;
|
|
const value = environment.__proto__;
|
|
const NavigatorHeader = (NavigatorHeaderNativeModule).NavigatorHeader;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const h850Ss = (IndexNativeModule).t.h850Ss;
|
|
const value2 = null;
|
|
if (value2 != binding) {
|
|
moduleValue = require(4805) /* metro dependency 4805: useChannelName */;
|
|
r4 = moduleValue.computeChannelName(binding, UserStore, RelationshipStore, true);
|
|
} else {
|
|
r4 = value2;
|
|
}
|
|
return <NavigatorHeader title={Reflect.apply(string, intl, [h850Ss])} subtitle={r4} />;
|
|
}
|
|
|
|
function getScreens_83813Render() { // fn#83815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:2876, owner: getScreens_83813.render, offset: 0x01f29ac5, size: 34 bytes, params: 1, frame: 13
|
|
return <ConnectedInAppNotificationSettingsScreen channel={env0_0} />;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun83816(a0) { // fn#83816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:503, offset: 0x01f29ae7, size: 153 bytes, params: 2, frame: 16
|
|
const InAppNotificationSettingsScreen2 = InAppNotificationSettingsScreen;
|
|
Inherits(InAppNotificationSettingsScreen2, a0);
|
|
return CreateClass(InAppNotificationSettingsScreen2, [{key: 'renderGroupDMNotificationSettings', value: value_83820},
|
|
{key: 'renderTextChannelNotificationSettings', value: value_83821}, {key: 'renderChannelNotificationSettings',
|
|
value: function() {
|
|
var property = this.props.channel;
|
|
if (property != null) {
|
|
property = property.type;
|
|
if (ChannelTypes.GROUP_DM === property) {
|
|
return this.renderGroupDMNotificationSettings();
|
|
}
|
|
if (ChannelTypes.GUILD_TEXT === property) {
|
|
return this.renderTextChannelNotificationSettings();
|
|
}
|
|
if (ChannelTypes.GUILD_ANNOUNCEMENT === property) {
|
|
return this.renderTextChannelNotificationSettings();
|
|
}
|
|
}
|
|
return null;
|
|
}}, {key: 'render', value: value_83823}]);
|
|
function InAppNotificationSettingsScreen(a0) { // fn#83817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:515, offset: 0x01f29b80, size: 158 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_3;
|
|
binding(this, InAppNotificationSettingsScreen);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_6(InAppNotificationSettingsScreen);
|
|
binding = env1_5;
|
|
if (_isNativeReflectConstruct_83808()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_6(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.handleGroupDMMute = handleGroupDMMute;
|
|
value.handleOpenUserSettings = function() {
|
|
require(dependencyMap[15]).openUserSettings({screen: UserSettingsSections.NOTIFICATIONS});
|
|
};
|
|
return value;
|
|
function handleGroupDMMute() { // fn#83818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:814, owner: InAppNotificationSettingsScreen.handleGroupDMMute, offset: 0x01f29c1e, size: 138 bytes, params: 1, frame: 21
|
|
var defaultImport;
|
|
var updateChannelOverrideSettings;
|
|
var guildId;
|
|
var id;
|
|
var object;
|
|
var value3;
|
|
var NotificationLabel;
|
|
const props = env0_0.props;
|
|
const channel = props.channel;
|
|
if (channel != null) {
|
|
value = environment.__proto__.__proto__;
|
|
defaultImport = importDefault(6613) /* metro dependency 6613: NotificationSettingsModalActionCreators */;
|
|
updateChannelOverrideSettings = defaultImport.updateChannelOverrideSettings;
|
|
guildId = channel.getGuildId();
|
|
id = channel.id;
|
|
object = {};
|
|
value3 = !props.isMuted;
|
|
object.muted = value3;
|
|
NotificationLabel = (require(6610) /* metro dependency 6610: NotificationSettingsUtils */).NotificationLabel;
|
|
Reflect.apply(updateChannelOverrideSettings, defaultImport, [guildId, id, object,
|
|
NotificationLabel.muted(value3)]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function value_83820() { // fn#83820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:1186, offset: 0x01f29cdf, size: 214 bytes, params: 1, frame: 26
|
|
const {channel, isMuted} = this.props;
|
|
if (channel == null) {
|
|
return null;
|
|
}
|
|
const channelName = UseChannelNameModule.computeChannelName(channel, UserStore, RelationshipStore);
|
|
const FormSection = (NativeModule).FormSection;
|
|
const FormSwitchRow = (NativeModule).FormSwitchRow;
|
|
const intl = (IndexNativeModule).intl;
|
|
return (
|
|
<FormSection>
|
|
<FormSwitchRow
|
|
label={intl.format((IndexNativeModule).t['u/rEuc'],
|
|
{name: channelName})}
|
|
value={isMuted}
|
|
onValueChange={this.handleGroupDMMute}
|
|
/>
|
|
</FormSection>
|
|
);
|
|
}
|
|
|
|
function value_83821() { // fn#83821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:1528, offset: 0x01f29db5, size: 70 bytes, params: 1, frame: 15
|
|
var r0;
|
|
const channel = this.props.channel;
|
|
let value = null;
|
|
if (value == channel) {
|
|
r0 = value;
|
|
} else {
|
|
value = environment.__proto__;
|
|
value = importDefault(10935) /* metro dependency 10935: ChannelSettingsNotifications */;
|
|
value = ((Component) => <Component channelId={channel.id} />)(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_83823() { // fn#83823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:1939, offset: 0x01f29e60, size: 364 bytes, params: 1, frame: 29
|
|
const Form = (NativeModule).Form;
|
|
const items2 = [this.renderChannelNotificationSettings()];
|
|
const FormSection = (NativeModule).FormSection;
|
|
const object2 = {};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
object2.title = Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.clE4PU]);
|
|
const FormRow = (NativeModule).FormRow;
|
|
string = intl.string;
|
|
const cHMaba = (require(1244) /* metro dependency 1244: indexNative */).t.cHMaba;
|
|
const handleOpenUserSettings = this.handleOpenUserSettings;
|
|
const FormRow2 = (NativeModule).FormRow;
|
|
const Arrow = FormRow2.Arrow;
|
|
items2[1] = (
|
|
<FormSection {...object2}>
|
|
<FormRow
|
|
label={Reflect.apply(string, intl, [cHMaba])}
|
|
onPress={handleOpenUserSettings}
|
|
trailing={<Arrow />}
|
|
/>
|
|
</FormSection>
|
|
);
|
|
const FormHint = (NativeModule).FormHint;
|
|
items2[2] = (
|
|
<FormHint>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.avgbp1)}
|
|
</FormHint>
|
|
);
|
|
return (
|
|
<Form>
|
|
{items2}
|
|
</Form>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun83824({channelId, onClose}) { // fn#83824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11120:2952, offset: 0x01f29fcc, size: 119 bytes, params: 2, frame: 16
|
|
const value2 = env0_8.useMemo(function() {
|
|
return getScreens_83813(channelId, onClose);
|
|
}, [channelId, onClose]);
|
|
const Navigator = (NavigatorNativeModule).Navigator;
|
|
return <Navigator screens={value2} initialRouteName="IN_APP_NOTIFICATION_SETTINGS" />;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun83807, 10934, [6, 7, 15, 17, 18, 31, 1383, 1379, 3793, 4864, 1878, 661, 33, 6613, 6610, 7007, 4805,
|
|
7972, 1244, 10935, 566, 5282, 5280,
|
|
2]) /* metro module 10934, dependencies: [6, 7, 15, 17, 18, 31, 1383, 1379, 3793, 4864, 1878, 661, 33, 6613, 6610, 7007, 4805, 7972, 1244, 10935, 566, 5282, 5280, 2] */;
|