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

60 lines
1.8 KiB
TypeScript

// Metro module 9050 (f9051).
import { Linking } from "react-native";
import { PlatformTypes } from "../../../Constants";
import GameConsoleAlertUtils from "../GameConsoleAlertUtils";
import { disconnectRemote, getConnectNonce, waitForSession } from "../GameConsoleActionCreators";
import getXboxURIForChannel from "../getXboxURIForChannel";
import AlertActionCreators from "../../../actions/native/AlertActionCreators";
import trackVoiceCallTransfer from "../trackVoiceCallTransfer";
import { stopOwnStream } from "../../../actions/StreamActionCreators";
function $mk115399($env) {
return () => {
const r1 = $env;
return import("./XboxInstallAlert").then($mk118112(r1));
};
}
function $mk118112($env) {
return (a0) => {
let env31987 = {
$parent: $env
};
env31987[0] = a0.default;
return (a0) => env31987.$parent[7](env31987[0], {
...a0
});
};
}
let env5920 = {};
export default async function transferToXbox(c26351_0) {
let c26351_1, c26351_2;
L18: {
let env30019;
const r34 = env5920;
c26351_2 = r34;
const r10 = env30019 = {
$parent: r34
};
c26351_1 = r10;
env30019[0] = c26351_0;
env30019[1] = void 0;
env30019[2] = void 0;
await GameConsoleAlertUtils.maybeShowPTTAlert(PlatformTypes.XBOX);
await disconnectRemote();
env30019[1] = await getConnectNonce();
env30019[2] = getXboxURIForChannel(env30019[0], {
nonce: env30019[1],
forQRCode: false
});
if (await Linking.canOpenURL(env30019[2])) {
trackVoiceCallTransfer(env30019[0].id, PlatformTypes.XBOX);
waitForSession(PlatformTypes.XBOX, env30019[0].id, env30019[1]);
stopOwnStream(false);
Linking.openURL(env30019[2]);
break L18;
}
return AlertActionCreators.openLazy({
importer: $mk115399(env5920)
});
}
};