302 lines
15 KiB
TypeScript
302 lines
15 KiB
TypeScript
/* Metro module 13112; source: components_native/ErrorBoundary.tsx; dependencies: [6, 7, 15, 17, 18, 5, 57, 31, 27, 10557, 33, 4501, 566, 10558, 4578, 1244, 1216, 694, 1305, 9165, 4573, 3868, 2] */
|
|
import Module00005 from '../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
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 Module00057 from '../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import SentryUtilsNative from '../utils/SentryUtils.native.tsx'; /* Metro dependency 1216 */
|
|
import BuildOverrideStore from '../modules/build_overrides/BuildOverrideStore.tsx'; /* Metro dependency 10557 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
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 IndexNativeModule from '../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NativeModule from '../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */
|
|
import * as CreateStylesModule from '../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as ButtonNativeModule from '../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
|
|
function _fun100197(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:6, offset: 0x021e0e58, size: 468 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const env0_16 = (CreateStylesModule).createLegacyClassComponentStyles({buttons: {'position': 'absolute',
|
|
'right': 32, 'bottom': 32, 'left': 32, 'gap': 12}, debugLogsContainer: {'position': 'absolute', 'right': 32,
|
|
'top': 64, 'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'gap': 12},
|
|
error: {'marginTop': 24, 'textAlign': 'center'}, text: {textAlign: 'center'}});
|
|
const PureComponent = value.PureComponent;
|
|
value = _fun100207(PureComponent);
|
|
const ThemeContext = (NativeModule).ThemeContext;
|
|
value.contextType = ThemeContext;
|
|
(FileImportTrackerModule).fileFinishedImporting('components_native/ErrorBoundary.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_100198() { // fn#100198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:253, offset: 0x021e102c, 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_100198_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function MaybeClearBuildOverride() { // fn#100201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:746, offset: 0x021e108e, size: 238 bytes, params: 1, frame: 20
|
|
let [property, env0_0] = Module00057(env0_10.useState(false), 2);
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
if (Reflect.apply(useStateFromStores, FluxModule, [[BuildOverrideStore], function() {
|
|
var r0;
|
|
var property = BuildOverrideStore.getCurrentBuildOverride().overrides;
|
|
var value2 = undefined;
|
|
if (property == null) {
|
|
r0 = value2;
|
|
} else {
|
|
property = property[require(dependencyMap[13]).DEVICE_FIELD];
|
|
r0 = property == null ? value2 : property.id;
|
|
}
|
|
return r0;
|
|
}]) == null) {
|
|
return null;
|
|
}
|
|
const Button = (ButtonNativeModule).Button;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
return (
|
|
<Button
|
|
variant="secondary"
|
|
loading={property}
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/Nz9rY'])}
|
|
onPress={function() {
|
|
return _clearOverride.apply(this, arguments);
|
|
}}
|
|
/>
|
|
);
|
|
function _clearOverride() { // fn#100202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:996, owner: MaybeClearBuildOverride._clearOverride, offset: 0x021e117c, size: 53 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
return env1_8(_fun100204).apply(this, arguments);
|
|
function* _fun100204() { // fn#100204, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:1047, offset: 0x021e11bc, size: 97 bytes, params: 1, frame: 13
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var value4;
|
|
var clearBuildOverride;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var error;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
try {
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
require(true);
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding = env3_0;
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding2 = env3_2;
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = binding2[13];
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value4 = binding(property);
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
clearBuildOverride = value4.clearBuildOverride;
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value5 = Reflect.apply(clearBuildOverride, value4, []);
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
yield value5;
|
|
try {
|
|
value6 = undefined;
|
|
value7 = false;
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
if (value7) {
|
|
return value6;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun100207(a0) { // fn#100207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:1337, offset: 0x021e126f, size: 199 bytes, params: 2, frame: 16
|
|
const ErrorBoundary_1002082 = ErrorBoundary_100208;
|
|
Inherits(ErrorBoundary_1002082, a0);
|
|
return CreateClass(ErrorBoundary_1002082, [{key: 'componentDidCatch', value: function(a0, a1) {
|
|
this.triggerSoftCrash(a0, a1);
|
|
}}, {key: 'triggerSoftCrash', value: value_100210}, {key: 'handleReload', value: function() {
|
|
var BundleUpdaterManager = NativeModules.BundleUpdaterManager;
|
|
BundleUpdaterManager.reload();
|
|
}}, {key: 'componentDidMount', value: function() {
|
|
var env0_0 = this;
|
|
if (global.window.DiscordErrors == null) {
|
|
global.window.DiscordErrors = {softCrash: _fun100213};
|
|
this.discordErrorsSet = true;
|
|
}
|
|
}}, {key: 'componentWillUnmount', value: function() {
|
|
if (this.discordErrorsSet) {
|
|
global.window.DiscordErrors = null;
|
|
this.discordErrorsSet = false;
|
|
}
|
|
}}, {key: 'render', value: value_100215}]);
|
|
function ErrorBoundary_100208(a0) { // fn#100208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:1349, offset: 0x021e1336, size: 154 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_3;
|
|
binding(this, ErrorBoundary_100208);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_6(ErrorBoundary_100208);
|
|
binding = env1_5;
|
|
if (_isNativeReflectConstruct_100198()) {
|
|
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.state = {'error': null, 'info': null};
|
|
value.discordErrorsSet = false;
|
|
return value;
|
|
}
|
|
|
|
function value_100210(a0, a1) { // fn#100210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:1794, offset: 0x021e13e9, size: 113 bytes, params: 3, frame: 17
|
|
this.setState({error: a0, info: a1});
|
|
const value = environment.__proto__;
|
|
(SentryUtilsNative).captureCrash(a0, {extra: a1});
|
|
(Dispatcher).dispatch({'type': 'CLEAR_CACHES',
|
|
'reason': 'App Crashed'});
|
|
}
|
|
|
|
function value_100212() { // fn#100212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:2071, offset: 0x021e1475, size: 67 bytes, params: 1, frame: 5
|
|
const DiscordErrors = global.window.DiscordErrors;
|
|
if (DiscordErrors == null) {
|
|
global.window.DiscordErrors = {softCrash: softCrash};
|
|
this.discordErrorsSet = true;
|
|
}
|
|
function softCrash(a0) { // fn#100213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:2161, owner: value_100212.softCrash, offset: 0x021e14b8, size: 25 bytes, params: 2, frame: 11
|
|
env0_0.triggerSoftCrash(a0);
|
|
}
|
|
|
|
}
|
|
|
|
function value_100215() { // fn#100215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:2384, offset: 0x021e14f9, size: 523 bytes, params: 1, frame: 29
|
|
var r0;
|
|
var EmptyState;
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
var text;
|
|
var items3;
|
|
var items2;
|
|
const value = environment.__proto__;
|
|
const binding = env1_16;
|
|
const context = this.context;
|
|
const value2 = undefined;
|
|
const value3 = binding(context);
|
|
const error = this.state.error;
|
|
if (error !== null) {
|
|
EmptyState = (require(1305) /* metro dependency 1305: native */).EmptyState;
|
|
var emptyStateProps2 = {Illustration: (require(9165) /* metro dependency 9165: AppCrash */).AppCrash,
|
|
title: intl.string(t.tx8CkI), body: intl.string(t.CvQlAH)};
|
|
text = value3.text;
|
|
emptyStateProps2.titleStyle = text;
|
|
text = value3.text;
|
|
emptyStateProps2.bodyStyle = text;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
items3 = [
|
|
<Text
|
|
style={value3.error}
|
|
variant="text-sm/medium"
|
|
color="text-muted"
|
|
>
|
|
{(error == null ? value2 : error.message) ?? (error == null ? value2 : error.name) ?? 'Unknown Error'}
|
|
</Text>,
|
|
];
|
|
var viewBindingProps = {style: value3.buttons};
|
|
items2 = [
|
|
<MaybeClearBuildOverride />,
|
|
];
|
|
items2[1] = ((Button) => <Button text={intl.string(t['4n8OJn'])} onPress={this.handleReload} />)((require(4578) /* metro dependency 4578: ButtonNative */).Button);
|
|
items3[1] = (
|
|
<View {...viewBindingProps}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
items3[2] = null;
|
|
r0 = (
|
|
<EmptyState {...emptyStateProps2}>
|
|
{items3}
|
|
</EmptyState>
|
|
);
|
|
} else {
|
|
r0 = this.props.children;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun100197, 13112, [6, 7, 15, 17, 18, 5, 57, 31, 27, 10557, 33, 4501, 566, 10558, 4578, 1244, 1216, 694,
|
|
1305, 9165, 4573, 3868,
|
|
2]) /* metro module 13112, dependencies: [6, 7, 15, 17, 18, 5, 57, 31, 27, 10557, 33, 4501, 566, 10558, 4578, 1244, 1216, 694, 1305, 9165, 4573, 3868, 2] */;
|