28 lines
1.3 KiB
TypeScript
28 lines
1.3 KiB
TypeScript
// Metro module 10806 (f10807).
|
|
import GameConsoleStore from "../../../game_console/GameConsoleStore";
|
|
import { useStateFromStoresObject } from "../../../../_bundle/Module589";
|
|
import { PrimaryActionButton } from "./CallBarAction";
|
|
import Module7699 from "../../../../_bundle/Module7699";
|
|
import Module10761 from "../../../../_bundle/Module10761";
|
|
import { intl, t } from "../../../../intl/index.native";
|
|
import { remoteDisconnect, disconnectRemote } from "../../../game_console/GameConsoleActionCreators";
|
|
import { handleDisconnect } from "../../../voice_calls/native/CallsUtils";
|
|
export function DisconnectRemoteButton(props) {
|
|
let remoteSessionId;
|
|
const { channel, isSmallSize } = props;
|
|
remoteSessionId = void 0;
|
|
const stateFromStoresObject = useStateFromStoresObject([GameConsoleStore], () => ({
|
|
awaitingRemote: GameConsoleStore.getAwaitingRemoteSessionInfo() != null,
|
|
remoteSessionId: GameConsoleStore.getRemoteSessionId()
|
|
}));
|
|
remoteSessionId = stateFromStoresObject.remoteSessionId;
|
|
return <PrimaryActionButton source={stateFromStoresObject.awaitingRemote ? Module7699 : Module10761} accessibilityLabel={intl.string(t["6vrfgt"])} isSmallSize={isSmallSize} onPress={() => {
|
|
if (remoteSessionId != null) {
|
|
remoteDisconnect(remoteSessionId);
|
|
handleDisconnect(channel);
|
|
} else {
|
|
disconnectRemote();
|
|
}
|
|
}} />;
|
|
}
|