91 lines
3.9 KiB
TypeScript
91 lines
3.9 KiB
TypeScript
// Metro module 16171 (f16172).
|
|
import AuthenticationStore from "../../../stores/AuthenticationStore";
|
|
import { AnalyticEvents } from "../../../Constants";
|
|
import { FeedbackCategory, FeedbackType, StreamFeedbackOption } from "../../../modules/feedback/Constants";
|
|
import { useGetStreamApplication } from "../../../modules/go_live/utils/StreamerApplicationSelectors";
|
|
import { useStateFromStores } from "../../../_bundle/Module589";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import Feedback_messages from "../../../modules/feedback/intl/Feedback.messages";
|
|
import { getStreamFeedbackOptions, processOptOut } from "../../../modules/feedback/FeedbackUtils";
|
|
import FeedbackActionSheetV2 from "../../../modules/feedback/native/FeedbackActionSheetV2";
|
|
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
|
|
import trackStreamProblem from "../../../modules/go_live/utils/trackStreamProblem";
|
|
import { shouldShowLogUploadForCategory } from "../../../modules/feedback/shouldShowLogUploadForCategory";
|
|
import ActionSheetActionCreators from "../../../modules/action_sheet/native/ActionSheetActionCreators";
|
|
import { presentFeedbackSent } from "../../../modules/toast/native/ToastUtils";
|
|
export default function StreamFeedbackActionSheet(props) {
|
|
const { stream, analyticsData } = props;
|
|
const getStreamApplication = useGetStreamApplication(stream);
|
|
const stateFromStores = useStateFromStores([AuthenticationStore], () => AuthenticationStore.getId() === stream.ownerId);
|
|
const headerLabel = intl.string(t["5smP3R"]);
|
|
const r10 = intl.string(t["0uxA2V"]);
|
|
let ratingBody = intl.string(t.CqjnLN);
|
|
const r52 = {
|
|
value: stateFromStores ? FeedbackCategory.STREAMING : FeedbackCategory.STREAM_WATCHING,
|
|
label: intl.string(stateFromStores ? Feedback_messages["0ZBLiZ"] : Feedback_messages.TVTIT1),
|
|
problemsHeader: intl.string(t["6Y1t5P"]),
|
|
problemOptions: getStreamFeedbackOptions({
|
|
isStreamer: stateFromStores
|
|
}),
|
|
freeformConfig: {
|
|
value: StreamFeedbackOption.FREEFORM,
|
|
label: intl.string(t.emlT91)
|
|
}
|
|
};
|
|
if (stateFromStores) {
|
|
ratingBody = r10;
|
|
}
|
|
return <FeedbackActionSheetV2 headerLabel={headerLabel} showHeaderCloseButton ratingBody={ratingBody} categoriesHeader={intl.string(Feedback_messages.tq8598)} optionsTree={[r52]} trackOpen={function trackOpen() {
|
|
AnalyticsUtils.track(AnalyticEvents.OPEN_POPOUT, {
|
|
type: "Stream Feedback Sheet",
|
|
other_user_id: stream.ownerId,
|
|
application_id: getStreamApplication != null ? getStreamApplication.id : null,
|
|
application_name: getStreamApplication != null ? getStreamApplication.name : null,
|
|
game_id: getStreamApplication != null ? getStreamApplication.id : null
|
|
});
|
|
}} trackReport={function trackReport(a0) {
|
|
const { dontShowAgain, rating, category, reason } = a0;
|
|
let feedback = a0.feedback;
|
|
if (dontShowAgain) {
|
|
processOptOut({
|
|
feedbackType: FeedbackType.STREAM,
|
|
location: "StreamFeedbackActionSheet"
|
|
});
|
|
}
|
|
L17: {
|
|
if (rating != null) {
|
|
let problem = reason?.value;
|
|
if (problem == null) {
|
|
problem = null;
|
|
}
|
|
let variant = reason?.variant;
|
|
if (variant == null) {
|
|
variant = null;
|
|
}
|
|
if (feedback == null) {
|
|
feedback = "";
|
|
}
|
|
trackStreamProblem({
|
|
category,
|
|
problem,
|
|
variant,
|
|
stream,
|
|
feedback,
|
|
streamApplication: getStreamApplication,
|
|
analyticsData,
|
|
location: "Stream End",
|
|
rating
|
|
});
|
|
if (reason != null && shouldShowLogUploadForCategory(rating, category, reason)) {
|
|
ActionSheetActionCreators.openLazy(import("../../../modules/feedback/native/UploadLogsActionSheet"), "UploadLogs", {
|
|
mediaSessionId: analyticsData.media_session_id,
|
|
rtcConnectionId: analyticsData.rtc_connection_id
|
|
});
|
|
break L17;
|
|
}
|
|
presentFeedbackSent();
|
|
}
|
|
}
|
|
}} />;
|
|
};
|