Files
discord-decomp/sources/by-id/module-01563.jsx
T
2026-07-27 16:20:00 +03:00

68 lines
3.1 KiB
React

/* Metro module 1563; source: unknown; dependencies: [31, 1487, 1562] */
function _fun17522(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#17522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1690:6, offset: 0x00e6eeda, size: 91 bytes, params: 8, frame: 17
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
exports.default = useLinkTo;
}
function useLinkTo() { // fn#17523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1690:116, offset: 0x00e6ef35, size: 113 bytes, params: 1, frame: 17
const binding = env0_3;
const useContext = binding.useContext;
const NavigationContainerRefContext = (require(1487) /* metro dependency 1487 */).NavigationContainerRefContext;
return binding.useCallback(_fun17524, [binding.useContext(importDefault(1562) /* metro dependency 1562 */),
Reflect.apply(useContext, binding, [NavigationContainerRefContext])]);
}
function _fun17524(a0) { // fn#17524, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1690:241, offset: 0x00e6efa6, size: 396 bytes, params: 2, frame: 18
var r5;
var Error;
var options;
var value4;
var moduleValue;
var value7;
var moduleValue2;
var value8;
var value;
const value2 = undefined;
if (value2 === env0_0) {
throw new global.Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");
}
if (typeof a0 === 'string') {
if (a0.startsWith('/')) {
options = env0_1.options;
if (options == null) {
value4 = environment.__proto__;
moduleValue = require(1487) /* metro dependency 1487 */;
r5 = moduleValue.getStateFromPath(a0, options == null ? value2 : options.config);
} else if (options.getStateFromPath) {
r5 = options.getStateFromPath(a0, options.config);
} else {
value4 = environment.__proto__;
moduleValue = require(1487) /* metro dependency 1487 */;
r5 = moduleValue.getStateFromPath(a0, options == null ? value2 : options.config);
}
if (r5) {
value7 = environment.__proto__;
moduleValue2 = require(1487) /* metro dependency 1487 */;
value8 = moduleValue2.getActionFromState(r5, options == null ? value2 : options.config);
if (value2 !== value8) {
env0_0.dispatch(value8);
} else {
env0_0.reset(r5);
}
return value2;
}
throw new global.Error('Failed to parse the path to a navigation state.');
}
Error = global.Error;
value = "The path must start with '/' (" + a0 + ').';
throw new Error();
}
const binding = env0_0;
binding.navigate(a0.screen, a0.params);
return value2;
}