Conform more of the codebase to strictNullChecks (#10731)

This commit is contained in:
Michael Telatynski 2023-04-28 09:45:36 +01:00 committed by GitHub
parent 9f8113eabd
commit 1281c0746b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 147 additions and 119 deletions

View file

@ -48,14 +48,11 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
Modal.createDialog(BugReportDialog, {});
};
const rageshakeUrl = SdkConfig.get().bug_report_endpoint_url;
const hasFeedback = !!rageshakeUrl;
const hasFeedback = !!SdkConfig.get().bug_report_endpoint_url;
const onFinished = (sendFeedback: boolean): void => {
if (hasFeedback && sendFeedback) {
if (rageshakeUrl) {
const label = props.feature ? `${props.feature}-feedback` : "feedback";
submitFeedback(rageshakeUrl, label, comment, canContact);
}
const label = props.feature ? `${props.feature}-feedback` : "feedback";
submitFeedback(label, comment, canContact);
Modal.createDialog(InfoDialog, {
title: _t("Feedback sent"),
@ -65,8 +62,8 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
props.onFinished();
};
let feedbackSection;
if (rageshakeUrl) {
let feedbackSection: JSX.Element | undefined;
if (hasFeedback) {
feedbackSection = (
<div className="mx_FeedbackDialog_section mx_FeedbackDialog_rateApp">
<h3>{_t("Comment")}</h3>
@ -93,8 +90,8 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
);
}
let bugReports: JSX.Element | null = null;
if (rageshakeUrl) {
let bugReports: JSX.Element | undefined;
if (hasFeedback) {
bugReports = (
<p className="mx_FeedbackDialog_section_microcopy">
{_t(