Files
discord-decomp/modules/links/native/handleContentLinking.tsx
T
2026-11-01 12:12:55 +02:00

80 lines
2.4 KiB
TypeScript

// Metro module 9547 (f9548).
import { addPostConnectionCallback } from "../../gateway/PostConnectionCallbackStore";
import { Routes } from "../../../Constants";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import safeTransitionTo_native from "../safeTransitionTo.native";
import { transitionTo } from "../../routing/router_utils";
import SummaryActionCreators from "../../summaries/SummaryActionCreators";
function $mk115490($env) {
return (a0, a1) => {
const r2 = $env;
let env31503 = {
$parent: $env
};
env31503[0] = a0;
env31503[1] = a1;
r2[6] = () => (0, env31503[1])(new Error("superseded"));
(0, addPostConnectionCallback)(() => {
env31503.$parent[6] = null;
(0, env31503[0])();
});
};
}
let env6294 = {};
const c6294_6 = null;
export default async function handleContentLinking(c26467_0) {
let env30107;
const r35 = env6294;
let c26467_2 = r35;
const r10 = env30107 = {
$parent: r35
};
let c26467_1 = r10;
env30107[0] = void 0;
env30107[1] = void 0;
env30107[2] = void 0;
env30107[3] = void 0;
env30107[4] = void 0;
env30107[0] = c26467_0.guildId;
env30107[1] = c26467_0.channelId;
env30107[2] = c26467_0.navigationSettings;
env30107[3] = c26467_0.messageId;
env30107[4] = c26467_0.summaryId;
env30107[5] = void 0;
env30107[6] = void 0;
env30107[7] = void 0;
env30107[8] = void 0;
env30107[9] = void 0;
env30107[10] = void 0;
await void 0;
ModalActionCreators.popAll();
env30107[5] = env30107[2].safe;
env30107[6] = env30107[2].navigationReplace;
env30107[7] = env30107[6] === void 0 || env30107[6];
env30107[8] = env30107[2].waitForConnection;
env30107[9] = env30107[8] === void 0 || env30107[8];
env30107[10] = env30107[2].skipMessageFetch;
if (env30107[9]) {
if (c6294_6 != null) {
c6294_6();
}
await new Promise($mk115490(env6294));
}
if (env30107[5]) {
await safeTransitionTo_native(Routes.CHANNEL(env30107[0], env30107[1], env30107[3]), {
navigationReplace: env30107[7],
openChannel: true,
skipMessageFetch: env30107[10]
});
} else {
transitionTo(Routes.CHANNEL(env30107[0], env30107[1], env30107[3]), {
navigationReplace: env30107[7],
openChannel: true,
skipMessageFetch: env30107[10]
});
}
if (env30107[1] != null && env30107[4] != null) {
SummaryActionCreators.setSelectedSummary(env30107[1], env30107[4]);
}
};